Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 10066 invoked from network); 19 Sep 2008 17:25:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Sep 2008 17:25:05 -0000 Received: (qmail 75716 invoked by uid 500); 19 Sep 2008 17:25:02 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 75692 invoked by uid 500); 19 Sep 2008 17:25:02 -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 75678 invoked by uid 99); 19 Sep 2008 17:25:02 -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 10:25:02 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Sep 2008 17:24:11 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8884F234C1DD for ; Fri, 19 Sep 2008 10:24:44 -0700 (PDT) Message-ID: <939448115.1221845084558.JavaMail.jira@brutus> Date: Fri, 19 Sep 2008 10:24:44 -0700 (PDT) From: "Fay Wang (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Created: (OPENJPA-731) Bug on FetchType.EAGER when QuerySQLCache is turned on MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Bug on FetchType.EAGER when QuerySQLCache is turned on ------------------------------------------------------ Key: OPENJPA-731 URL: https://issues.apache.org/jira/browse/OPENJPA-731 Project: OpenJPA Issue Type: Bug Reporter: Fay Wang This JIRA is open on behalf of Enrico: OpenJPA 1.2.0 Bug on FetchType.EAGER Friday, September 19, 2008 12:49 AM From: "egoosen" Add sender to Contacts To: users@openjpa.apache.org 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; -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.