cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: How the cache works ?
Date Wed, 01 Aug 2007 16:48:11 GMT

On Aug 1, 2007, at 5:06 PM, Jean-Paul Le Fèvre wrote:

>       query.setName("SimulationSelection");

In 3.0 Cayenne builds the cache key internally based on the query  
semantics [1]. It doesn't require a query name to be present and will  
ensure that queries with different qualifiers/orderings/fetch limits/ 
etc. do not override each other in the cache.

Before 3.0 Cayenne would use a name of the query as THE cache key. So  
if you have two queries with say different qualifiers, but same name,  
a cached result of the first query would be returned for the second  
one as well. I think you may be seeing this behavior. Until you can  
upgrade to 3.0, I suggest copying 3.0 cache key algorithm [1] to your  
own method that would generate a cache-friendly query name.

Andrus


[1] http://svn.apache.org/repos/asf/cayenne/main/trunk/framework/ 
cayenne-jdk1.4-unpublished/src/main/java/org/apache/cayenne/query/ 
SelectQueryMetadata.java





  
Mime
View raw message