skip to main content
DataDirect tools : Connection Pool Manager : How connection pooling works
  

Try DataDirect Drivers Now

How connection pooling works

Typically, creating a connection is the most expensive operation an application performs. Connection pooling allows you to reuse connections rather than create a new one every time an application needs to connect to the database. Connection pooling manages connection sharing across different user requests to maintain performance and reduce the number of new connections that must be created. For example, compare the following transaction sequences.

Example A: Without connection pooling

1. The application creates a connection.
2. The application sends a query to the database.
3. The application obtains the result set of the query.
4. The application displays the result to the end user.
5. The application ends the connection.

Example B: With connection pooling

1. The application requests a connection from the connection pool.
2. If an unused connection exists, it is returned by the pool; otherwise, the pool creates a new connection.
3. The application sends a query to the database.
4. The application obtains the result set of the query.
5. The application displays the result to the end user.
6. The application closes the connection, which returns the connection to the pool.
Note: The application calls the close() method, but the connection remains open and the pool is notified of the close request.
* The connection pool environment
* The DataDirect Connection Pool Manager
* Using a connection pool DataSource object
* Using Reauthentication