Connection Reserve Timeout Limiting the Number of Waiting Connection Requests

Tuning Data Source Connection Pools 10-9

10.3 Enabling Connection Creation Retries

WebLogic JDBC data sources include the Connection Creation Retry Frequency option ConnectionCreationRetryFrequencySeconds in the JDBCConnectionPoolParamsBean that you can use to specify the number of seconds between attempts to establish connections to the database. If set and if the database is unavailable when the data source is created, WebLogic Server attempts to create connections in the pool again after the number of seconds you specify, and will continue to attempt to create the connections until it succeeds. This option applies to connections created when the data source is created at server startup or when the data source is deployed or if the initial capacity is increased. It does not apply to connections created for pool expansion or to replace a defunct connection in the pool. By default, Connection Creation Retry Frequency is 0 seconds. When the value is set to 0, connection creation retries is disabled and data source creation fails if the database is unavailable. See the JDBC Data Source: Configuration: Connection Pool page in the Administration Console or see JDBCConnectionPoolParamsBean in the Oracle WebLogic Server MBean Reference for more details about this option.

10.4 Enabling Connection Requests to Wait for a Connection

JDBC data sources have two attributes that you can set to enable connection requests to wait for a connection from a data source: Connection Reserve Timeout ConnectionReserveTimeoutSeconds and Maximum Waiting for Connection HighestNumWaiters. You use these two attributes together to enable connection requests to wait for a connection without disabling your system by blocking too many threads. See the JDBC Data Source: Configuration: Connection Pool page in the Administration Console or see JDBCConnectionPoolParamsBean in the Oracle WebLogic Server MBean Reference for more details about these options. Also see Enable connection requests to wait for a connection in the Administration Console Online Help.

10.4.1 Connection Reserve Timeout

When an application requests a connection from a data source, if all connections in the data source are in use and if the data source has expanded to its maximum capacity, the application will get a Connection Unavailable SQL Exception. To avoid this, you can configure the Connection Reserve Timeout value in seconds so that connection requests will wait for a connection to become available. After the Connection Reserve Timeout has expired, if no connection becomes available, the request will fail and the application will get a PoolLimitSQLException exception. PostgreSQL SQL SELECT 1 Progress SQL SELECT COUNT FROM SYSTABLES Sybase SQL SELECT 1 Table 10–1 Cont. Default Test Table Name by DBMS DBMS Default Test Table Name Query 10-10 Oracle Fusion Middleware Configuring and Managing JDBC Data Sources for Oracle WebLogic Server If you set Connection Reserve Timeout to -1, a connection request will timeout immediately if there is no connection available. If you set Connection Reserve Timeout to 0, a connection request will wait indefinitely. The default value is 10 seconds. See Enable connection requests to wait for a connection in the Oracle WebLogic Server Administration Console Help.

10.4.2 Limiting the Number of Waiting Connection Requests

Connection requests that wait for a connection block a thread. If too many connection requests concurrently wait for a connection and block threads, your system performance can degrade. To avoid this, you can set the Maximum Waiting for Connection HighestNumWaiters attribute, which limits the number connection requests that can concurrently wait for a connection. If you set Maximum Waiting for Connection HighestNumWaiters to MAX-INT the default, there is effectively no bound on how many connection requests can wait for a connection. If you set Maximum Waiting for Connection to 0, connection requests cannot wait for a connection. If the maximum number of requests has been met, a SQLException is thrown when an application requests a connection.

10.5 Automatically Recovering Leaked Connections