Configuring connection validation timeout

You can configure a timeout for connection validation by the Java Database Connectivity (JDBC) driver through a data source custom property in the data source configuration panels.

About this task

You can choose between validating connections with the JDBC driver or by having the application server run a SQL query. Select one or both of the following connection pretest attributes: By default, connection validation is disabled. When you save the configuration for the data source, the administrative console supplies only the option that is selected. The administrative console will select validation by timeout or validation by a query, but if validation is not enabled then the application server will select neither option.

Procedure

  1. Open the administrative console.
  2. Go to the WebSphere Application Server Data Source properties panel for the data source.
    1. Select Resources > JDBC > Data Sources > data_source
    2. Select WebSphere Application Server Data Source properties.
  3. Go to the Connection Validation Properties section.
  4. Select the type of connections that the application server will validate.
    • Select Validate new connections. This option specifies that the connection manager tests newly created connections to the database.
    • Select Validate existing pooled connections. This options specifies that the connection manager tests the validity of pooled connections before returning them to applications.
    • You can also select both options
      Avoid trouble Avoid trouble: You must make a selection here. If you do not select one or both of these options, you will not be able to select Validation by JDBC Driver. The Validation by JDBC Driver timeout feature is only available for JDBC providers that comply with the JDBC 4.0 specification.

      For an Oracle datasource, Validation by JDBC Driver appears on the administrative console only after the validateNewConnectionTimeout property is added to the [Updated in September 2013] custom properties of the datasource [Updated in September 2013]

      sep2013
      . The validateNewConnectionTimeout property is used for JDBC 4.0 driver validation and can be specified using administrative console.

      gotcha
      .
  5. Click Validation by JDBC Driver. The application server issues a warning if Validation by JDBC driver is configured and the JDBC driver does not implement JDBC 4.0, or if the Connection.isValid method raises an error.
    Deprecated feature Deprecated feature: Connection validation by SQL query is deprecated. Use validation by JDBC Driver instead.depfeat
  6. Enter the timeout value in the input box. The timeout value is in seconds.
    Avoid trouble Avoid trouble: If retries are configured, meaning the retry interval is not set to 0, for Validate new connections or Validate existing pooled connections, then the full value of the timeout applies to each retry. For each retry, the application server waits for the retry interval. Then the JDBC driver uses the full value of the timeout to validate the connectiongotcha
  7. Save the data source configuration.

What to do next

If you are modifying an existing data source, restart your server for this change to go into effect. If this is a new data source, restarting the server is not necessary.



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic Task topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Feb 6, 2014 8:11:25 PM CST
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=matt&product=was-nd-mp&topic=tdat_connectimeout
File name: tdat_connectimeout.html