+

Search Tips   |   Advanced Search

Connection pool (Version 4) settings


To create a connection pool for a V4.0 data source.

We can access this admin console page in one of two ways:

Scope

Resources such as JDBC providers, namespace bindings, or shared libraries can be defined at multiple scopes, with resources defined at more specific scopes overriding duplicates which are defined at more general scopes.

Note that no matter what the scope of a defined resource, the resource's properties only apply at an individual server level. For example, if we define the scope of a data source at the cell level, all users in that cell can look up and use that data source, which is unique within that cell. However, resource property settings are local to each server in the cell. For example, if we define max connections to 10, then each server in that cell can have 10 connections.

When resources are created, they are always created into the current scope selected in the panel. To view resources in other scopes, specify a different node or server in the scope selection form.

For general information, see Administrative console scope settings in the Related Reference section.

Data type String

Minimum pool size

Minimum number of connections to maintain in the pool.

The minimum pool size can affect the performance of an application. Smaller pools require less overhead when the demand is low because fewer connections are held open to the database. When the demand is high, the first applications experience a slow response because new connections are created if all others in the pool are in use.

Data type Integer
Default 1
Range Any non-negative integer.

Maximum pool size

Maximum number of connections to maintain in the pool.

If the maximum number of connections is reached and all connections are in use, additional requests for a connection wait up to the number of seconds specified as the connection timeout. The maximum pool size can affect the performance of an application. Larger pools require more overhead when demand is high because there are more connections open to the database at peak demand. These connections persist until idled out of the pool. If the maximum value is smaller, longer wait times or possible connection timeout errors during peak times can occur. Verify the database can support the maximum number of connections in the appserver, in addition to any load that it has outside of the appserver.

Data type Integer
Default 10
Range Any positive integer

Connection timeout

Maximum number of seconds an application waits for a connection from the pool before timing out and triggering a ConnectionWaitTimeout exception. WAS acts on this value only if we set the maximum pool size property, in which case the number of maximum connections serves as a trigger for enforcing the wait timeout property.

Data type Integer
Units Seconds
Default 180
Range Any non-negative integer

Set this value to 0 disables the connection timeout.

If we accept the default value, Application Server issues the ResourceAllocation exception immediately after the pool manager indicates that the maximum number of connections are in use. If we disable connection timeout, Application Server does not issue an exception. Instead, the pool manager queues subsequent connection requests until it can allocate a connection.

Idle timeout

Maximum number of seconds that an idle (unallocated) connection can remain in the pool before being removed to free resources.

Connections need to idle out of the pool because keeping connections open to the database can cause database memory problems. However, not all connections are idled out of the pool, even if they are older than the Idle Timeout setting. A connection is not idled if removing the connection would cause the pool to shrink below its minimum size. Setting this value to 0 disables the idle timeout.

Data type Integer
Units Seconds
Default 1800
Range Any non-negative integer

Orphan timeout

Maximum number of seconds that an application can hold a connection without using it before the connection returns to the pool

If there is no activity on an allocated connection for longer than the Orphan Timeout setting, the connection is marked for orphaning. After another Orphan Timeout number of seconds, if the connection still has no activity, the connection returns to the pool. If the application tries to use the connection again, it is issued a stale connection exception. Connections that are enlisted in a transaction are not orphaned. Setting this value to 0 disables the orphan timeout.

Data type Integer
Units Seconds
Default 1800
Range Any non-negative integer

Statement cache size

Number of cached prepared statements to keep per connection.

The largest value you would need to set the cache size to if we do not want any cache discards is determined as follows: for each application that uses this data source on a particular server, add up the number of unique prepared statements (as determined by the sql string, concurrency, and the scroll type). This is the maximum number of possible prepared statements that can be cached on a given connection over the life of the server. Setting the cache size to this value means you never have cache discards. This provides better performance. However, because of potential resource limitations, this might not always be possible.

Data type Integer
Default 10
Range Any non-negative integer

Disable auto connection cleanup

Whether the connection pooling software automatically closes connections from the data source at the end of a transaction. Set this property to maintain and reuse the same connection across multiple transactions.

The default is false, which indicates that when a transaction completes, the appserver closes the connection and returns it to the pool. Any use of the connection after the transaction has ended results in a stale connection exception, because the connection is closed and has returned to the pool. This mechanism ensures that connections are not held indefinitely by the application. If the value is set to true, the connection is not returned to the pool at the end of a transaction. In this case, the application must return the connection to the pool by calling the close() method. If the application does not close the connection, the pool can run out of connections for other applications to use.

Data type Boolean (check box)
Default False (clear)





Related concepts


JDBC providers
Data sources
Connection pooling

 

Related tasks


Set a data source
Set connection factories for resource adapters within applications
Set Java EE Connector connection factories in the admin console

 

Related


Administrative console scope settings
Administrative console preference settings