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
This archive was generated by hypermail 2.0.0 : Wed Aug 01 2007 - 12:48:39 EDT