Select the product you need help with
INFO: Connection Pool Management by ADO Objects Called From ASPArticle ID: 191572 - View products that this article applies to. This article was previously published under Q191572 On This PageSUMMARY
When using ActiveX Data Objects (ADO) within an Active Server Pages (ASP)
page, it is important to know how to utilize connection pooling
effectively. When using different combinations of implicit and explicit ADO
connections with ADO recordsets and commands instantiated with
Server.CreateObject or just CreateObject, it is possible for the connections to not be returned to the connection pool. The table in the "More Information" section depicts possible scenarios and outcomes. Note Connections that use the Jet OLE DB providers and ODBC drivers are not pooled because those providers and drivers do not support pooling. MORE INFORMATION
By following a connection type from the left of the grid, and a recordset or command type from the top of the grid, you can find the answers to the
following two questions:
|Recordset |Recordset |Command |Command
|created |created |created |created
|with |with |with |with
|Server. |CreateObject |Server. |CreateObject
|CreateObject | |CreateObject |
-----------------------------------------------------------------------
Explicit |1.Yes |1.Yes |1.Yes |1.Yes
Connection |2.Conn.Close |2.Conn.Close |2.Conn.Close |2.Conn.Close
created with | | | |
Server. | | | |
CreateObject | | | |
-----------------------------------------------------------------------
Explicit |1.Yes |1.Yes |1.Yes |1.Yes
Connection |2.Conn.Close |2.Conn.Close |2.Conn.Close |2.Conn.Close
created with | | | |
CreateObject | | |
---------------------------------------------------------------------------
Implicit |1.No |1.Yes |1.No |1.No
Connection |2.N/A |2.Set |2.N/A |2.N/A
| | Recordset | |
| | = Nothing | |
---------------------------------------------------------------------------
Sample CodeNote You must change UID=<username> and PWD=<strong password> to the correct values before you run these codes. Make sure that UID has the appropriate permissions to perform this operation on the database. How to Recreate These Tests
ConclusionIt is generally not a good practice to implicitly create connections. When a connection is implicitly created you do not have a handle to the connection to call and close the connection. The connection continues to remain open and unused until the connection times out. The default timeout with connection pooling enabled for SQL Server is 60 seconds. When connection pooling is not on, SQL Server drops the connection immediately after the ASP page has been parsed but there are other performance issues to consider when connection pooling is not on.REFERENCES
For additional information about connection pooling, please see the following article(s) in the Microsoft Knowledge Base:
169470
For additional information about connectionADO/ASP Scalability, please see the following article(s) in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/169470/EN-US/
)
INF: Frequently Asked Questions About ODBC Connection Pooling
176056
(http://support.microsoft.com/kb/176056/EN-US/
)
INFO: ADO/ASP Scalability FAQ
Properties |


Back to the top








