Minimized Connection Test Delay After Database Connectivity Loss Minimized Connection Request Delay After Connection Test Failures

10-6 Oracle Fusion Middleware Configuring and Managing JDBC Data Sources for Oracle WebLogic Server Testing reserved connections can cause a delay in satisfying connection requests, but it makes sure that the connection is viable when the application gets the connection. You can minimize the impact of testing reserved connections by tuning Seconds to Trust an Idle Pool Connection. See Section 10.2.1.7, Minimizing Connection Request Delay with Seconds to Trust an Idle Pool Connection.

10.2.1.4 Minimized Connection Test Delay After Database Connectivity Loss

When connectivity to the DBMS is lost, even if only momentarily, some or all of the JDBC connections in a data source typically become defunct. If the data source is configured to test connections on reserve, when an application requests a database connection, WebLogic Server tests the connection, discovers that the connection is dead, and tries to replace it with a new connection to satisfy the request. Ordinarily, when the DBMS comes back online, the refresh process succeeds. However, in some cases and for some modes of failure, testing a dead connection can impose a long delay. To minimize this delay, WebLogic data sources include logic that considers all connections in the data source as dead after a number of consecutive test failures, and closes all connections in the data source. After all connections are closed, when an application requests a connection, the data source creates a connection without first having to test a dead connection. This behavior minimizes the delay for connection requests following the data sources connection pool flush. WebLogic Server determines the number of test failures before closing all connections based on the Test Frequency setting for the data source: ■ If Test Frequency is greater than 0, the number of test failures before closing all connections is set to 2. ■ If Test Frequency is set to 0 periodic testing is disabled, the number of test failures before closing all connections is set to 25 of the Maximum Capacity for the data source.

10.2.1.5 Minimized Connection Request Delay After Connection Test Failures

If your DBMS becomes and remains unavailable, the data source will persistently test and try to replace dead connections while trying to satisfy connection requests. This behavior is beneficial because it enables the data source to react immediately when the database becomes available. However, testing a dead database connection can take as long as the network timeout, and can cause a long delay for clients. To minimize this delay, the WebLogic data sources include logic that disables the data source after 2 consecutive failures to replace a dead connection. When an application requests a connection from a disabled data source, WebLogic Server throws a PoolDisabledSQLException immediately to notify the client that a connection is not available. For data sources that are disabled in this manner, WebLogic Server periodically runs a refresh process. The refresh process does the following: ■ The server instance executes a health check on the database server every 5 seconds. This setting is not configurable. ■ If the server instance recognizes that the database was recovered, it creates a new database connection and enables the data source. You can also manually enable the data source using the Administration Console. Tuning Data Source Connection Pools 10-7

10.2.1.6 Minimized Connection Request Delays After Loss of DBMS Connectivity