Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 55352 invoked from network); 31 Jan 2011 19:27:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Jan 2011 19:27:29 -0000 Received: (qmail 22597 invoked by uid 500); 31 Jan 2011 19:27:29 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 22532 invoked by uid 500); 31 Jan 2011 19:27:28 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 22524 invoked by uid 99); 31 Jan 2011 19:27:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Jan 2011 19:27:28 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [91.121.30.210] (HELO 27.mail-out.ovh.net) (91.121.30.210) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 31 Jan 2011 19:27:19 +0000 Received: (qmail 15476 invoked by uid 503); 31 Jan 2011 19:30:05 -0000 Received: from b9.ovh.net (HELO mail625.ha.ovh.net) (213.186.33.59) by 27.mail-out.ovh.net with SMTP; 31 Jan 2011 19:29:57 -0000 Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 31 Jan 2011 21:26:46 +0200 Received: from mol92-1-82-67-218-223.fbx.proxad.net (HELO ?172.16.1.10?) (j-b.briaud%novlog.com@82.67.218.223) by ns0.ovh.net with SMTP; 31 Jan 2011 21:26:44 +0200 From: Jean-Baptiste BRIAUD -- Novlog Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: OpenJPA rock and fetch plan is a killing feature. Date: Mon, 31 Jan 2011 20:26:44 +0100 Message-Id: <09057867-617A-4DF2-8C69-A6ED1BD518EB@novlog.com> To: users@openjpa.apache.org Mime-Version: 1.0 (Apple Message framework v1082) X-Mailer: Apple Mail (2.1082) X-Ovh-Tracer-Id: 933371023288295462 X-Ovh-Remote: 82.67.218.223 (mol92-1-82-67-218-223.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Spam-Check: DONE|U 0.5/N Hi the list, I realize I often post when I have a question or when something goes = wrong. I decided to post because I'm happy with OpenJPA and everything is fine. I'd like to share I'm really happy with fetch plan that we use heavily. As a consequence, we are no more using lazy loading at all. Instead, we're defining what we need using fetch plan and get only what = we need. We didn't have time to test under heavy load or with a heavy database = but one of our customer did compare the new system we made to previous = system and feel it is really quicker. Nothing prove it is due exclusively to fetch plan but it is still = positive. Let me try to quickly explain the benefit of fetch plan. Say we have to cook that French cake "Charlotte aux fraises". Using lazy loading, here what's happen : 1. OK, I need 10 strawberry, let's run to the shop and comeback quickly. 2. read the cook book further : I also need those special element = "biscuit a la cuilliere", OK, let's go to the shop 3. read next step ... Guess what, it is slow and I get bored to go to that shop every time ! Now, let's use fetch plan : 1. Read the cook book for "Charlotte aux fraises". Ok, I need 10 strawberry and some "biscuit a la cuilliere". 2. Go to the shop and buy everything at once, following a list I've = written. 3. Cook that cake without going to the shop anymore. I just can't understand why fetch plan approach is not the default way. ... and with fetch plan too I could add cache and this could speed up = things. For lazy loading, cache is not an answer, it is a way to hide problems = or more precisely, to hide my ignorance about what exact data I need as = a Java developer. What's the point of doing OO model in UML if that information is ignored = because of lazy loading ? The danger, and I met that situation often on customer cases, is to = loose the control. Sometimes, no one in the dev team know exactly what data is used because = of lazy loading. In some hard case, one have to reverse engineer by spying SQL to recover = information of what part of the app need what data. Also, concurrency become harder to solve because data dependencies are = not written anywhere. So, lazy loading in some particular cases, why not, but default approach = should be using fetch plan. On the other hand, we were not in the case of very very complex request = or "action" in the database. Even in such cases, I'm not sure lazy loading would helps. Conclusion : thanks OpenJPA, you're the only one I know with such = powerful feature. I stop using Hibernate because fetch plan was missing (and the code was = easy to migrate). JBB. --- The data I need and only the data I need.