cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pedro Aquilino Sánchez (JIRA) <j...@apache.org>
Subject [jira] [Created] (CAY-1585) SelectQuery automatic cache key needs FetchOffset
Date Sat, 02 Jul 2011 16:48:21 GMT
SelectQuery automatic cache key needs FetchOffset
-------------------------------------------------

                 Key: CAY-1585
                 URL: https://issues.apache.org/jira/browse/CAY-1585
             Project: Cayenne
          Issue Type: Bug
          Components: Core Library
    Affects Versions: 3.1M2
            Reporter: Pedro Aquilino Sánchez
            Priority: Minor
             Fix For: 3.1 (final)


SelectQueryMetadata.resolve:

Must include the fetchOffset property from query.
So we can cache correctly pagination queries.

for example without this property:

SelectQuery query = new SelectQuery(Example.class);
query.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
query.setFetchOffset(0);
query.setFetchLimit(10);
ctx.performQuery(query);
// Returns the first ten elements, cached under key "Example/10"

Select query2 = new SelectQuery(Example.class);
query2.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
query2.setFetchOffset(10);
query2.setFetchLimit(10);
ctx.performQuery(query2);
// Returns the first ten elements from cache, this is not correct it must return the next
block of elements.
// Because the cache key is again "Example/10"



--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message