skip to main content
Getting Started : Advanced Features : Using Connection Pooling
  
Using Connection Pooling
Typically, creating a connection is the most performance-expensive operation that an application performs. Connection pooling allows you to reuse connections rather than create a new one every time a driver needs to establish a connection 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.
For details, see the following topics:
* Understanding Connection Pooling
* Using Reauthentication