Connection Pool in Depth Connection Pool
The new JDBC connection pool in WebLogic Server 8.1 is built on top of a new generic resource pool implementation that is shared across multiple subsystems, including JDBC, Connector, and JMS. It now offers many new and enhanced features: InactiveConnectionTimeoutSeconds
You can use this feature to configure the number of seconds of inactivity after which a reserved connection will automatically be reclaimed by the connection pool. This will help you circumvent the problem of application code leaking connections and eventually emptying the connection pool of all connections.
To enable this feature, set the attribute "InactiveConnectionTimeoutSeconds" on the configuration MBean weblogic.management.configuration.JDBCConnectionPo olMBean.
ConnectionCreationRetryFrequencySeconds
You can use this feature to configure the connection pool to automatically retry creating connections to the DBMS if the DBMS is currently not available or accessible. This also enables you to create and deploy the connection pool even if the DBMS is currently not available or accessible.
Set the attribute "ConnectionsCreationRetryFrequencySeconds" on the configuration MBean weblogic.management.configuration.JDBCConnectionPo olMBean to enable this feature. ConnectionReserveTimeoutSeconds
You can use this feature to control how long a request to get a connection from a connection pool waits for a connection while blocking a thread before being timing out.
Set the attribute "ConnectionReserveTimeoutSeconds" on the configuration MBean weblogic.management.configuration.JDBCConnectionPo olMBean to enable this feature.
HighestNumWaiters
You can use this feature to control the maximum number of concurrent requests to get a connection from a connection pool that will be enqueued, after which additional concurrent requests will be rejected.
Set the attribute "HighestNumWaiters" on the configuration MBean weblogic.management.configuration.JDBCConnectionPo olMBean to enable this feature.
HighestNumUnavailable
You can use this feature to control the maximum number of connections in the pool that can be made unavailable (to applications) for the purpose of testing and (if required) refreshing the connection. This resolves the problem with the older pool implementation where the entire pool was locked while its connections were being tested and refreshed.
Set the attribute "HighestNumUnavailable" on the configuration MBean weblogic.management.configuration.JDBCConnectionPo olMBean to enable this feature. TestConnectionsOnCreate
You can use this feature to enable the testing of newly created connections. Every time a connection is created or refreshed, it is tested using the SQL query specified ion in the connection pool attribute "TestTableName".
Set the attribute "TestConnectionsOnCreate" on the configuration MBean weblogic.management.configuration.JDBCConnectionPo olMBean to enable this feature. InitSQL
You can use this feature to configure SQL statements to execute on a connection when it is created or refreshed. This can be used to do one-time initialization of physical connections as they get created.
Set the attribute "InitSQL" on the configuration MBean weblogic.management.configuration.JDBCConnectionPo olMBean to enable this feature.
Dynamic reconfiguration
Most connection pool configuration attributes are now dynamically tunable. You do not need to restart WebLogic Server or redeploy the connection pool for the new attribute values to take effect.
WebLogic Server Extensions to java.sql.SQLException
When JDBC drivers throw SQLExceptions, the reason for the exception is either embedded inside the exception message or in vendor-specific error codes. This requires applications to parse the exception messages to diagnose the failure. WebLogic Server now offers custom extension types to java.sql.SQLException to indicate specific failure conditions that can occur when the application tries to get a connection from a connection pool. |