Community
Participate
Working Groups
I am trying to get the eclipse link query result cache to work with <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode> setting in persistence.xml, so far without success. It works fine with DISABLE_SELECTIVE and ALL. Here's a NamedQuery example: @NamedQuery(name = "MyEntity.findAll", query = "select m from MyEntity m where m.active=true order by m.id", hints = { @QueryHint(name = QueryHints.CACHE_USAGE, value = CacheUsage.CheckCacheThenDatabase), @QueryHint(name = QueryHints.QUERY_TYPE, value = QueryType.ReadAll), @QueryHint(name = QueryHints.QUERY_RESULTS_CACHE, value = HintValues.TRUE) })} Even though the QUERY_RESULTS_CACHE is enabled, every execution of the named query hits the database. If it matters MyEntity has both a @Cacheable and a annotation and org.eclipse.persistence.annotations.Cache. I also tried using the JPA2 properties: @QueryHint(name = QueryHints.CACHE_STORE_MODE, value="USE"), @QueryHint(name = QueryHints.CACHE_RETRIEVE_MODE, value="USE")
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Community: Please vote for this bug if it is important to you. Votes are one of the main criteria we use to determine which bugs to fix next.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink