jdbc.timeout

Use eclipselink.jdbc.timeout to specify number of seconds Oracle TopLink will wait (time out) for a query result, before throwing a DatabaseExcpetion.

Note:

This property requires JDBC driver support.

Values

Table 4-20 describes this query hint's valid values.

Table 4-20 Valid Values for eclipselink.jdbc.timeout

Value Description

from 0 to Integer.MAX_VALUE

(Default = 0) As a String, depending on your JDBC driver.

If 0, Oracle TopLink will never time out waiting for a query.


Examples

Example 4-40 shows how to use this hint in a JPA query.

Example 4-40 Using jdbc.timeout in a JPA Query

import org.eclipse.persistence.config.CacheUsage;
 import org.eclipse.persistence.config.QueryHints;
 query.setHint(QueryHints.JDBC_TIMEOUT, "100");

Example 4-41 shows how to use this hint with the @QueryHint annotation.

Example 4-41 Using jdbc.timeout in a @QueryHint Annotation

import org.eclipse.persistence.config.CacheUsage;
 import org.eclipse.persistence.config.TargetDatabase;
 @QueryHint(name=QueryHints.JDBC_TIMEOUT, value="100");

See Also

For more information, see:

  • "query-type"

  • "About JPA Query Hints" in Understanding Oracle TopLink

  • "Enhancing Performance" in Solutions Guide for Oracle TopLink