[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] descriptor.disableCacheHits() does not disable cache hits

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@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/eclipselink-users
> 
> 

-- 
View this message in context: http://www.nabble.com/descriptor.disableCacheHits%28%29-does-not-disable-cache-hits-tp18826932p18827601.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.