12. Understanding .NET Data Provider Connectivity : .NET Data Provider Architecture : Connection Pooling
 
Share this page                  
Connection Pooling
Connection pooling significantly enhances the performance and scalability of some applications. Physical connections are kept in a pool after they are no longer needed by one application and are dispensed later to the same or another application (as needed) to avoid the cost of connections. All connections in a pool have identical connection strings. A new pool is created for each connection that has a different connection string from all other pools.
When an application attempts to connect to a database, the Open method of the IngresConnection object uses the connection pool to search for a physical connection that specifies the same ConnectionString parameters. If no match is found, a new physical connection is made to the database. If a match is found, a connection is returned to the application from the pool.
After the application has completed its work, committed its changes, freed its database locks and resources, and closed the connection, the physical connection is retained by the .NET data provider and placed back in the connection pool instead of being physically disconnected.
This connection is available to the same application later in the application's life span or to other applications in the same process with the same connection parameters. This avoids the overhead and delay of opening a new physical connection. An application can choose to disable connection pooling by specifying “Pooling=no” in its connection string.
The application is unaware of the connection reuse. If the connection is not reused within sixty seconds, the connection is physically closed to release system resources.
However, if the number of connections in the pool falls below the minimum number of connections specified by the application in the “Min Pool Size=n” value in the connection string, the connection is not physically closed and is retained in the pool for later use. For additional information on connection pooling, see IngresConnection Class.