PRB: Implicit Connections Created by the SQL Server OLE DB Provider (SQLOLEDB) Are Not Pooled (271128)
The information in this article applies to:
- Microsoft OLE DB Provider for SQL Server 7.0
- Microsoft OLE DB Provider for SQL Server 7.01
- Microsoft Data Access Components 2.1
- Microsoft Data Access Components 2.5
This article was previously published under Q271128 SYMPTOMS
When the Microsoft OLE DB Provider for SQL Server (SQLOLEDB) creates implicit connections, these connections are not pooled.
The provider creates implicit connections under the following two situations:
- If you create additional sessions from the same data source object while keeping the first session open, the provider creates implicit connections to the SQL Server for each additional session.
- If you execute multiple commands from the same connection, and you are specifying read-only, forward-only (default resultset) cursors. Because SQL Server doesn't allow more than one pending resultset per connection per default-resultset (also known as firehose) cursor, the provider will implicitly create another connection if DBPROP_MULTIPLECONNECTIONS is set to VARIANT_TRUE (the default).
In both cases, the implicit connection, which is created by the provider, is not pooled. This can lead to poor performance compared to opening and closing the connection explicitly. For more information on this behavior, see the article "How Consumers Use Resource Pooling" at the following MSDN Web site:
CAUSE
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.
RESOLUTION
To ensure pooling, you must create additional data source/session pairs, or explicitly create ActiveX Data Objects (ADO) connections. By explicitly creating the ADO connection or OLE DB Session, you can be guaranteed that the connection will be pooled by OLE DB, which means that the next request for an ADO connection or OLE DB Session can reuse an existing session and SQL Server connection.
Modification Type: | Major | Last Reviewed: | 12/5/2003 |
---|
Keywords: | kbDatabase kbprb kbProvider KB271128 |
---|
|