Return-Path: Delivered-To: apmail-openjpa-users-archive@locus.apache.org Received: (qmail 37436 invoked from network); 19 Sep 2008 12:30:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Sep 2008 12:30:12 -0000 Received: (qmail 7931 invoked by uid 500); 19 Sep 2008 12:30:08 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 7907 invoked by uid 500); 19 Sep 2008 12:30:08 -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 7891 invoked by uid 99); 19 Sep 2008 12:30:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Sep 2008 05:30:08 -0700 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kwsutter@gmail.com designates 209.85.200.170 as permitted sender) Received: from [209.85.200.170] (HELO wf-out-1314.google.com) (209.85.200.170) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Sep 2008 12:29:08 +0000 Received: by wf-out-1314.google.com with SMTP id 28so550144wfc.24 for ; Fri, 19 Sep 2008 05:29:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=MORbm0oNezipglQh8zbM55r0a0I7yS4PZJycabjgASk=; b=KvVh+sKviozvFJB5pZ+E8LY297+32Azejemaq0C+l0KY2yZQ8qFx/ChlJWM/hSnc+n nqx3Hz1dJ/Kjcmd0uaWIUBy+LGu1IZm3iQKeeSeayZQqeZUTP5U0oKmODOce2b764P+y ffMYj2etkn+wyIDX8IboMNVSoGIDLvxnBgNQs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=VN4b0iDlAzIUGHN2rRymdoVYXaXoqzQ+/yzs9JknHm3vAP8xeaNyr9CDU5kIy8F3ZK JSPgBXMea5FLobYY2uNvVJT1gdjkEK40iPVGyhLsQHJtv17i8Ej6IDQe+dey4T6lp18b 0RAYJ/M8CJaD3j6KByjuOzyS5PBVDt6EpfQlI= Received: by 10.142.134.20 with SMTP id h20mr7894wfd.21.1221827371611; Fri, 19 Sep 2008 05:29:31 -0700 (PDT) Received: by 10.142.135.10 with HTTP; Fri, 19 Sep 2008 05:29:31 -0700 (PDT) Message-ID: <89c0c52c0809190529h26344740q5367b3ad63916752@mail.gmail.com> Date: Fri, 19 Sep 2008 07:29:31 -0500 From: "Kevin Sutter" To: users@openjpa.apache.org Subject: Re: OpenJPA 1.2.0 Bug on FetchType.EAGER In-Reply-To: <1221810595670-1100274.post@n2.nabble.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_29582_29632938.1221827371594" References: <1221810595670-1100274.post@n2.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_29582_29632938.1221827371594 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Egoosen2, One new feature that went into 1.2.0 was the ability to cache some of the generated sql on common queries. Previous to this change, every query or findBy operation required the same sql to be generated over and over again. It may be possible that the caching is picking up the wrong sql for the scenario that you describing. As a quick test, could you try running with this sql query cache turned off? The property follows: openjpa.jdbc.QuerySQLCache = false If you could try this and let us know the results, it will help with narrowing down the scope of the problem. Thanks! Kevin On Fri, Sep 19, 2008 at 2:49 AM, egoosen wrote: > > I'm experiencing a strange bug in 1.2.0, on an eager loaded one to many > relationship. > The first time I run the code, openJPA retrieves the parent entity and > eager > fetches the CORRECT child entities. > The second time around, it fetches the parent entity and fetches the > INCORRECT child entities (specifically, it fetches the child entities of > the > parent entity in the previous query). > > Here's the SQL to illustrate: > First run: > SELECT t0.AMDCTL_ID, t0.VRS_NBR, t0.AMDSEQ_CDE, t0.DPLORD_NBR, t0.FND_CDE, > t0.RSL_DTE FROM EBSTATUS.TBL_AMDCTL t0 WHERE t0.FND_CDE = ? > [params=(String) 0000001] > SELECT t0.AMDCTL_ID, t1.AMDDES_ID, t1.VRS_NBR, t1.AMD_DES, t1.AMDCTL_ID, > t1.EFC_DTE FROM EBSTATUS.TBL_AMDCTL t0 INNER JOIN EBSTATUS.TBL_AMDDES t1 ON > t0.AMDCTL_ID = t1.AMDCTL_ID WHERE t0.FND_CDE = ? ORDER BY t0.AMDCTL_ID ASC > [params=(String) 0000001] > > Second run: > SELECT t0.AMDCTL_ID, t0.VRS_NBR, t0.AMDSEQ_CDE, t0.DPLORD_NBR, t0.FND_CDE, > t0.RSL_DTE FROM EBSTATUS.TBL_AMDCTL t0 WHERE t0.FND_CDE = ? > [params=(String) 0001001] > SELECT t0.AMDCTL_ID, t1.AMDDES_ID, t1.VRS_NBR, t1.AMD_DES, t1.AMDCTL_ID, > t1.EFC_DTE FROM EBSTATUS.TBL_AMDCTL t0 INNER JOIN EBSTATUS.TBL_AMDDES t1 ON > t0.AMDCTL_ID = t1.AMDCTL_ID WHERE t0.FND_CDE = ? ORDER BY t0.AMDCTL_ID ASC > [params=(String) 0000001] > > Somehow its caching the second query, even though I've turned off the > DataCache and QueryCache. > > I've had to revert back to OpenJPA 1.1.0. > > Here's my mappings: > TblAmdctl.java > @OneToMany(mappedBy="tblAmdctl",fetch = FetchType.EAGER,cascade = { > CascadeType.PERSIST,CascadeType.MERGE}) > private Collection tblAmddess = new ArrayList(); > > TblAmddes.java > @ManyToOne(fetch = FetchType.LAZY,cascade = { > CascadeType.PERSIST,CascadeType.MERGE }) > @JoinColumns({@JoinColumn(name = > "AMDCTL_ID",referencedColumnName="AMDCTL_ID")}) > @ForeignKey > private TblAmdctl tblAmdctl; > > -- > View this message in context: > http://n2.nabble.com/OpenJPA-1.2.0-Bug-on-FetchType.EAGER-tp1100274p1100274.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. > > ------=_Part_29582_29632938.1221827371594--