Managing Connection Pooling
JDBC Connector Service offers connection pooling to enable better performance of the system. Re-using connections is less time- and resource-consuming than creating new ones each time your application or client sends a request for connection.
You can manage the number of pooled connections, as well as their lifetime to achieve best performance by your application or client.
To administer connection pooling parameters for a DataSource object, use the Runtime tab of JDBC Connector Service in Visual Administrator:
...
1. In the Resources → DataSources → <applicationName> tree select a DataSource.
2. In the Additional tab specify the following parameters:
|
Parameter |
Description |
Recommended Value |
|
Initial Connections |
Number of connections that are obtained initially when the DataSource is created |
We recommend that you have a few (1-2) connections created initially to enable fast connectivity to the database once your application sends a request for connection. However, keeping a free connection in your pool even when you do not use it, might prevent other clients from obtaining a connection to the database, if the maximum number of supported connections is reached. Therefore, use the Initial Connections option only when the database supports a large number of connections and there are always free connections left. |
|
Maximum Connections |
Number of maximum connections from a single DataSource that are kept in the pool |
The value of this parameter depends on how often your application connects to the database. If you need to connect multiple times, or there are many clients working with the database simultaneously, set a higher value for the number of connections that your pool contains. Thus, you are able to connect to the database fast, without having to wait for a connection to be released. |
|
Maximum Time to Wait for Connection |
When the maximum number of supported connections is reached and there are no free connections in the pool, the client waits the specified interval to obtain a connection. If the system does not return a connection to the pool during the interval, you get an exception thrown. |
|
|
Expiration |
Enables the parameters for connection life control – that is, Connection Lifetime and Cleanup Thread. By default, this option is disabled. |
|
|
Connection Lifetime |
A period in seconds, after which the connection expires if it is not in use |
|
|
Cleanup Thread |
An interval in seconds between two consecutive threads run by the system to clean up unused connections |
|
3.
Choose
Save Changes on the
toolbar.

These parameters are also saved when you export data about DataSource objects to an XML file, and are loaded when you import data from an XML file. For more information about importing and exporting data, see DataSource Data Import and Export.