I have positive result with the following usage
@Entity
@Cache (
type=CacheType.WEAK,
expiry=600000,
alwaysRefresh =true,
disableHits=false,
coordinationType=CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES
)
@NamedQueries( {
@NamedQuery(name = "CodFlexCodesB.findAll",
query = "select o from CodFlexCodesB o"),
@NamedQuery(name = "CodFlexCodesB.timeValidity",
query = "SELECT em FROM CodFlexCodesB em " +
"WHERE em.codFlexCodeSystemsB.id = :id AND " +
"(em.startDate <= :endDate) AND (em.endDate >= :startDate OR em.endDate IS NULL) ",
hints = @QueryHint(name=QueryHints.CACHE_USAGE, value=CacheUsage.ConformResultsInUnitOfWork )
)
})
May be it helps.
elygre wrote:
While working with caching, I have customized a class descriptor, calling
"descriptor.disableCacheHits();". I figured that this would make multiple
calls to "em.find(key)" generate multiple SQL-statements to the database.
This does not happen, and then I wonder why. There is really not much else
going on, in terms of configuration and setup. Anything I need to switch on?
Eirik
_______________________________________________
eclipselink-users mailing list
eclipselink-users@eclipse.org
https://dev.eclipse.org/mailman/listinfo/eclipselink-users