cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: CayenneRuntimeException: Can't find id
Date Sat, 19 Jan 2008 21:59:02 GMT
> When I remove setPageSize, caching works, so it's paradoxically better
> than with paging. With paging, on every page cayenne retrieves full
> table + records relevant for the page.

Yes, the cache settings are skipped for paginated queries for various  
technical reasons (except for the ROP scenario that Ari mentioned - it  
was hand coded for this case)... although I think we should make it  
work in all situations...

> So how can I make cayenne 2.x read IDs (or full table and retain only
> IDs) on first paginated query run and then query only for relevant
> records?

You can save a paginated list in a session (or in the whatever scope  
the DataContext it belongs to resides).

Andrus




On Jan 19, 2008, at 10:11 PM, Daniel Kvasnička jr. wrote:
>> Firstly, this is really quite fast. We use this approach on a Swing
>> application (three tier) with our largest customer now with 120,000
>> contacts in one table. Pulling this across the network takes only a
>> few seconds. Remember that Cayenne is just fetching the primary key
>> from the database for all but the page of data you want to fault.
>
> Well, from that SQL log and from what Andrus have said it doesn't seem
> so. You're probably using 3.0?
>
> Also, I've tried setting a name for the query and tried all of the
> cache policies listed here
> http://cayenne.apache.org/doc20/caching-query-results.html and cayenne
> still fetches everything on every page load -- with whatever cache
> policy I choose.
> When I remove setPageSize, caching works, so it's paradoxically better
> than with paging. With paging, on every page cayenne retrieves full
> table + records relevant for the page. Without paging, caching works,
> so full table is read, but only once and on every page there is "SQL
> silence" from now on (it is evident that this is unusable -- storing
> whole table in the cache)
>
> So how can I make cayenne 2.x read IDs (or full table and retain only
> IDs) on first paginated query run and then query only for relevant
> records? Am I doing something wrong when setting cache policy?
>
> -- 
> http://www.danielkvasnicka.net -- webdesign & corporate design,
> programování internetových a intranetových aplikací
>


Mime
View raw message