Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 76618 invoked from network); 14 Nov 2007 13:46:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Nov 2007 13:46:18 -0000 Received: (qmail 42023 invoked by uid 500); 14 Nov 2007 13:46:05 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 42010 invoked by uid 500); 14 Nov 2007 13:46:05 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 42001 invoked by uid 99); 14 Nov 2007 13:46:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Nov 2007 05:46:05 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.78.103.231] (HELO vorsha.objectstyle.org) (208.78.103.231) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 14 Nov 2007 13:46:09 +0000 Received: (qmail 27848 invoked from network); 14 Nov 2007 13:45:48 -0000 Received: from unknown (HELO ?????na??p???????IPv6:::1?) (127.0.0.1) by localhost with SMTP; 14 Nov 2007 13:45:48 -0000 Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: References: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Andrus Adamchik Subject: Re: Batch faulting with Cayenne 3 Date: Wed, 14 Nov 2007 08:45:47 -0500 To: user@cayenne.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org Can you use prefetching instead? You got a list of users vis some sort of query - just add prefetch to that query. Andrus On Nov 14, 2007, at 8:11 AM, Alexander Lamb (dev) wrote: > Hello list, > > One thing is killing performance of our application: it is the > resolving of individual to-one faults in lists. > > For example, we can have 200 roles each refering to a person. > > When we loop through the roles, for each role where we do a > role.getPerson() there will be a return trip to the database. > > In the EOF days, there was a possibility to define a batch faulting > strategy for the entity. In that we would say for example "batch > fault 20 for person" and the first time a to-one fault to person > from role would be found, it would look in the data context for up > to 19 more to build a single SQL statement and fetch in one go the > person objects and resolve up to 20 faults. > > Is this feature available somewhere in Cayenne 3m2 or planned in > the near future? > > If not, is there some kind of callback or hook wich would allow us > to do the same thing? > > Thanks, > > Alex >