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


query-results-cache.randomize-expiry

Use eclipselink.query-results-cache.randomize-expiry to specify the expiry time (query-results-cache.expiry) should be randomized by 10% of its set value.


Values

Table 4-31 describes this query hint's values.

Table 4-31 Valid Values for query-results-cache.randomize-expiry

Value Description

true

Randomize the expiration time by 10%.

false

(Default) Do not randomize the expiration time.



Usage

Use this query hint to avoid bottlenecks from multiple cached values expiring at a fixed time.


Examples

Example 4-63 Using query-results-cache.randomize-expiry in a JPA Query

import org.eclipse.persistence.config.HintValues;
 import org.eclipse.persistence.config.QueryHints;
 query.setHint("eclipselink.QUERY_RESULTS_CACHE_RANDOMIZE_EXPIRY", "TRUE");

Example 4-64 Using query-results-cache.randomize-expiry in a @QueryHint Annotation

import org.eclipse.persistence.config.HintValues;
 import org.eclipse.persistence.config.QueryHints;
 @QueryHint(name=QueryHints.QUERY_RESULTS_CACHE_RANDOMIZE_EXPIRY, value="TRUE");


See Also

For more information, see: