Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 10973 invoked from network); 3 Oct 2007 16:52:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Oct 2007 16:52:22 -0000 Received: (qmail 75565 invoked by uid 500); 3 Oct 2007 16:39:17 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 75539 invoked by uid 500); 3 Oct 2007 16:39:17 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 75529 invoked by uid 99); 3 Oct 2007 16:39:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2007 09:39:17 -0700 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 (athena.apache.org: domain of lists@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, 03 Oct 2007 16:39:18 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Id7CO-0000HC-UV for dev@openjpa.apache.org; Wed, 03 Oct 2007 09:35:48 -0700 Message-ID: <13022684.post@talk.nabble.com> Date: Wed, 3 Oct 2007 09:35:48 -0700 (PDT) From: rgarret To: dev@openjpa.apache.org Subject: Lazy loading not working. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: RGARRET@co.pierce.wa.us X-Virus-Checked: Checked by ClamAV on apache.org Hello, I am have several fields that are being eagerly loaded when they should not be. Here's a simple example to illustrate my problem: public class Test { private TestEnumeration testEnum; // TestEnumeration is an enumeration (go figure) private TestBean testBean; // TestObject is just a regular bean @ManyToOne( fetch = FetchType.LAZY ) @Column( name = "test_enumeration_id", nullable = false ) public TestEnumeration getTestEnum( ) { return testEnum; } @OneToOne( cascade = CascadeType.ALL, fetch = FetchType.LAZY ) @JoinColumn( name = "test_bean_id", nullable = false, updatable = false ) @ForeignKey public TestBean getTestBean( ) { return testBean; } } I have made certain that neither testBean nor testEnum are in any active fetch groups and yet they are still eagerly fetched. According to my logs they are not fetched due to being accessed, rather, they are pulled immediately as if they were in a fetch group or declared eager. I do not have this issue with collections (OneToMany) and if in the above example I change the annotation on testEnum from @ManyToOne(fetch=FetchType.LAZY) to @Basic(fetch=FetchType.LAZY) it behaves properly. In summation, all of my non-collection joined fields seem get fetched eagerly despite being defined as lazy and not being in any active fetch group. Am I doing something wrong or is this a bug? Thanks! -Reece -- View this message in context: http://www.nabble.com/Lazy-loading-not-working.-tf4562936.html#a13022684 Sent from the OpenJPA Developers mailing list archive at Nabble.com.