Return-Path: Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 71466 invoked by uid 500); 25 Aug 2003 21:21:52 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 71445 invoked from network); 25 Aug 2003 21:21:51 -0000 Received: from logos.org.ua (81.19.74.120) by daedalus.apache.org with SMTP; 25 Aug 2003 21:21:51 -0000 Received: from localhost.localdomain ([213.130.8.202]) (authenticated bits=0) by logos.org.ua (8.12.9/8.12.8) with ESMTP id h7PKY36m089732 for ; Mon, 25 Aug 2003 23:34:07 +0300 (EEST) Content-Type: text/plain; charset="us-ascii" From: Oleg Nitz Reply-To: on@ukr.net To: ojb-dev@db.apache.org Subject: Batch retrieval Date: Mon, 25 Aug 2003 23:36:33 +0000 User-Agent: KMail/1.4.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200308252336.33912.on@ukr.net> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi! I have commited some changes to the OJB core, but if they are not in time= ,=20 they can be easily turned off via the 'autoPrefetch' field in=20 PersistenceBrokerImpl.java The idea is to make retrieval more efficient via gathering them into batc= hes=20 (less queries =3D> less network and database hits). For the "broker" junit tests the number of SELECT queries is reduces by 9= %,=20 for "odmg" junit tests - by 18%, but I expect much more gain in the real = life=20 complicated object structures. How does it works? During every getCollectionByQuery() call of=20 PersistenceBroker all objects that should be retrieved via relations with= =20 auto-retrieve=3D"true" (without proxies and without QueryCustomizer), are not retrieved immediately, but the tasks for their retrieval are=20 collected. They are gathered into groups of similar tasks and executed at= the=20 end of getCollectionByQuery().=20 Also this means that during retrieval of one object of class A which has = 1:N=20 relation to class B which has 1:N relation to class C and N:1 relation to= =20 class D, all C's and and D's will be loaded by one query for each relatio= n. This algoritm uses Jackob's prefetching classes, but methods that modify=20 metadata are not used.=20 Regards, Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org