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.
Table 4-20 describes this query hint's valid values.
Table 4-20 Valid Values for eclipselink.jdbc.timeout
Value | Description |
---|---|
from |
(Default = If 0, Oracle TopLink will never time out waiting for a query. |
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");
For more information, see:
"About JPA Query Hints" in Understanding Oracle TopLink
"Enhancing Performance" in Solutions Guide for Oracle TopLink