Java Persistence API (JPA) Extensions Reference for EclipseLink, Release 2.5
  Go To Table Of Contents
 Search
 PDFComments
Comments


jdbc.timeout

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


NoteNote:

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, 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: