Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A081DBAB5 for ; Thu, 12 Jan 2012 16:28:07 +0000 (UTC) Received: (qmail 70913 invoked by uid 500); 12 Jan 2012 16:28:07 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 70658 invoked by uid 500); 12 Jan 2012 16:28:03 -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 70632 invoked by uid 99); 12 Jan 2012 16:28:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jan 2012 16:28:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jan 2012 16:28:00 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 5AE2F14785B for ; Thu, 12 Jan 2012 16:27:39 +0000 (UTC) Date: Thu, 12 Jan 2012 16:27:39 +0000 (UTC) From: "Rick Curtis (Updated) (JIRA)" To: dev@openjpa.apache.org Message-ID: <1266268579.34894.1326385659374.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <771186586.30674.1326304539418.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (OPENJPA-2107) ManagedCache conflict due adding an entity 2 times in the same query. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-2107?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rick Curtis updated OPENJPA-2107: --------------------------------- Attachment: OPENJPA-2107.patch Mark - It looks like we put this bug in with OPENJPA-2051. Give this patch a try. Note, I haven't had time to try to run this patch through the entire test bucket yet. > ManagedCache conflict due adding an entity 2 times in the same query. > --------------------------------------------------------------------- > > Key: OPENJPA-2107 > URL: https://issues.apache.org/jira/browse/OPENJPA-2107 > Project: OpenJPA > Issue Type: Bug > Components: kernel > Affects Versions: 2.2.0 > Reporter: Mark Struberg > Assignee: Mark Struberg > Fix For: 2.2.0 > > Attachments: OPENJPA-2107.patch > > > I have a complex query which creates the following error: > org.apache.openjpa.persistence.ArgumentException: Cannot load object with id "26301". Instance "at.ac.tuwien.tiss.curriculum.be.entities.DefaultCourse@6e267b76" with the same id already exists in the L1 cache. This can occur when you assign an existing id to a new instance, and before flushing attempt to load the existing instance for that id. > FailedObject: at.ac.tuwien.tiss.curriculum.be.entities.DefaultCourse-26301 > at org.apache.openjpa.kernel.ManagedCache.add(ManagedCache.java:126) > at org.apache.openjpa.kernel.BrokerImpl.setStateManager(BrokerImpl.java:4117) > at org.apache.openjpa.kernel.StateManagerImpl.initialize(StateManagerImpl.java:391) > at org.apache.openjpa.kernel.StateManagerImpl.initialize(StateManagerImpl.java:340) > at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.initializeState(JDBCStoreManager.java:378) > It seems that this entity gets loaded from the db twice in the same query. > While hitting the problem, the StateManagers have the following _flags: > orig _flags= 602 = 0010 0101 1010 SAVE LOADED READ_LOCKED OID_ASSIGNED FLUSHED > sm _flags= 16 = 0000 0001 0000 READ_LOCKED > And it is really only 1 instance which makes this problem. If I set the 'orig' variable to null in the debugger, the test runs fine. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira