Use eclipselink.jdbc.timeout
to specify number of seconds EclipseLink 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 |
(Default = If 0, EclipseLink 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:
"About JPA Query Hints" in Understanding EclipseLink
"Enhancing Performance" in Solutions Guide for EclispeLink