You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Dzmitry Kazimirchyk (JIRA)" <ji...@apache.org> on 2011/08/03 13:20:27 UTC

[jira] [Updated] (CAY-1585) SelectQuery automatic cache key needs FetchOffset

     [ https://issues.apache.org/jira/browse/CAY-1585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dzmitry Kazimirchyk updated CAY-1585:
-------------------------------------

    Fix Version/s: 3.0.3

> 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
>            Assignee: Dzmitry Kazimirchyk
>            Priority: Minor
>             Fix For: 3.0.3, 3.1M3
>
>
> 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