audit logout
audit logout
tracestop
而如果每句cnn.execute后面加上rs.close(),则每个execute之前不会有audit login事件,而是连续的3个sql:stmtstarting事件。
这样频繁建立物理连接,是否会影响性能?照例说应该重用同一个连接才对呀?
cause:
这种情况叫做隐式登录。
当set一个ado.recordset对象接收ado.connection.execute返回的记录集时,就会出现隐式登录,再次和数据库服务器建立一次物理连接,而且这个连接还没有办法重用,也不能池化。
这个的原因是:
because the sql server ole db provider doesn't permit more than one set of results to be pending on a connection where the results are being returned by means of a forward-only, read-only (default-resultset) cursor, the provider needs to create an additional sql server connection to execute a second command on the connection. the provider will only do this implicitly if the data source property dbprop_multipleconnections is set to variant_true.
可以参考微软的kb文档:
http://support.microsoft.com/default.aspx?scid=kb;en-gb;q271128&gssnb=1