|
Hi, What I can see when I use paging in combination with SQLTemplate is this: Cayenne first runs the main SQLTemplate query which is stored in memory When I get the first page it determines the key values of the main query which it then uses in a new query which will return the main table plus the detail table data. This will produce the main table object through which the detail table is accessible. The problem here is that the key of the main table is used only. The SQLTemplate query was manually constructed and does a query on the main table and a left join to the detail table so this will produce a duplicate key value where a main table record has 2 related detail table records. This doesnt have to be a problem, actually the query does return the number of records used as page size. But internally in cayenne something weird happens. Somehow the duplicate records are remove and the IncrementalFaultList.checkPageResultConsistency method throws an exception for this. Because the main query returns the main object but also the detail object I find it strange that the query generated for the page only uses the main table key. I would expect that it also would use the key of the detail table. An example. Say I have a main table key 1 and related detail records with key 1, 2 and 3. Say I run the SQLTemplate which returns key 1 but only key 1 and 2 for the detail table. The page query will now run for all detail records and return all records which I did not request. >From this I'm concluding that if an SQLTemplate is used it is not usefull (read: faulty) to include the detail table in this query. When paging is used all the detail tables are automatically queried. If I write the main SQLTemplate query such it only returns the main object then the Exception does not occur. My conclusion is then that if you want to use paging with SQLTemplate the main query should only return the main table. Prefetching will then return ALL related table records. tx HPI Andrus Adamchik wrote: Yeah, still need to check that one. On Nov 12, 2009, at 10:43 AM, Hans Pikkemaat wrote: --
10 jaar TSi Solutions
... marktleider in het automatiseren en outsourcen van werkprocessen in de reisbranche ... toonaangevende partij voor het verzamelen, structureren en beschikbaarstellen van reiscontent ... Reisrevue Innovatieveer 2008 - Veervolle vermelding ... Winnaar Reisrevue Innovatieveer 2009 ... Top 20 positie in 2008 Deloitte Technology Fast50 Nederland ... Top 10 positie in 2009 Deloitte Technology Fast50 Benelux ... genomineerd voor Technology 500 EMEA 2009 TSi
Solutions is de handelsnaam van Travel Service
International b.v.[KvK 06091935]
DISCLAIMER: De informatie opgenomen in dit bericht kan
vertrouwelijk zijn en is uitsluitend bestemd voor de geadresseerde.
Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. The information contained in this message may be
confidential and is intended to be exclusively for the addressee.
Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. |
Title: html versie van handtekening
- Object Caching Hans Pikkemaat
- Re: Object Caching Andrus Adamchik
- Re: Object Caching Hans Pikkemaat
- Re: Object Caching Andrus Adamchik
- Re: Object Caching Hans Pikkemaat
- Re: Object Caching Andrus Adamchik
- Re: Object Caching Hans Pikkemaat
- Re: Object Caching Hans Pikkemaat
- Re: Object Caching Aristedes Maniatis
- Re: Object Caching Andrus Adamchik
- Re: Object Caching Hans Pikkemaat
- Re: Object Caching Michael Gentry
- Re: Object Caching Hans Pikkemaat
- Re: Object Caching Michael Gentry
- Re: Object Caching Hans Pikkemaat
- Re: Object Caching Michael Gentry
- Re: Object Caching Andrus Adamchik


