skip to main content
Using the Driver : 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 Data Source Object