Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 85564 invoked from network); 23 Dec 2009 16:49:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Dec 2009 16:49:58 -0000 Received: (qmail 71227 invoked by uid 500); 23 Dec 2009 16:49:57 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 71163 invoked by uid 500); 23 Dec 2009 16:49:57 -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 71153 invoked by uid 99); 23 Dec 2009 16:49:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Dec 2009 16:49:57 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists+1214986160035-208411@n2.nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Dec 2009 16:49:48 +0000 Received: from jim.nabble.com ([192.168.236.80]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1NNUOt-0004sG-JZ for users@openjpa.apache.org; Wed, 23 Dec 2009 08:49:27 -0800 Date: Wed, 23 Dec 2009 08:49:27 -0800 (PST) From: StevenK To: users@openjpa.apache.org Message-ID: <1261586967599-4209525.post@n2.nabble.com> In-Reply-To: <1261578107625-4208800.post@n2.nabble.com> References: <1261423048051-4200062.post@n2.nabble.com> <1261578107625-4208800.post@n2.nabble.com> Subject: Re: FetchGroups and Embeddable Fields MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: StevenK X-Virus-Checked: Checked by ClamAV on apache.org We created an entity that contained some embedded fields and some non-embedded fields (string, ints, etc). All fields are lazy loaded (the default). We created a fetch plan that includes a couple of embedded fields and a couple of non-embedded fields. We then created a query that uses the fetch plan. We created a test that added a number of these entities to the database. We then looped through all the entities that were returned by the query and accessed each field. We turned sql tracing on so we could see what sql was generated and executed. What we found was that when we accessed the non-embedded fields, no sql was executed (we expected this because these fields were included in the fetch plan). When we accessed the embedded fields sql was executed (selects for those fields) indicating that the fields were still being lazy loaded and the fetch plan was not eagerly loading the data. We did not expect this as these fields were also part of the fetch plan. Have you worked with fetch plans that combined embedded and non-embedded fields? Any idea what might be causing this? Thanks for your help. Pinaki Poddar wrote: > >> Are their any restrictions, constraints, or other complications that >> anyone is aware of? > Nothing specific comes to mind. Are you seeing any anomaly w.r.t. embedded > fields in a fetch plan? > > > StevenK wrote: >> >> I am trying to optomize a query by using fetch groups. One of the fields >> I'd like to include in the group is an embedded entity. When I turn sql >> tracing on, run my query, and then display the value of the fields that >> were returned, I can see that the non-embedded fields in my entry display >> without additional selects from the database - which is exactly what I >> expect. The embedded fields however generate a select to the database to >> get their contents - which I am trying to avoid by including those fields >> in the fetch group. Has anyone else worked with fetch groups and >> embedded fields? Are their any restrictions, constraints, or other >> complications that anyone is aware of? >> >> Thanks! >> > > -- View this message in context: http://n2.nabble.com/FetchGroups-and-Embeddable-Fields-tp4200062p4209525.html Sent from the OpenJPA Users mailing list archive at Nabble.com.