Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 18691 invoked from network); 10 May 2007 02:20:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 May 2007 02:20:36 -0000 Received: (qmail 29706 invoked by uid 500); 10 May 2007 02:20:42 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 29673 invoked by uid 500); 10 May 2007 02:20:42 -0000 Mailing-List: contact open-jpa-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: open-jpa-dev@incubator.apache.org Delivered-To: mailing list open-jpa-dev@incubator.apache.org Delivered-To: moderator for open-jpa-dev@incubator.apache.org Received: (qmail 3046 invoked by uid 99); 10 May 2007 01:52:45 -0000 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of majeed.arni@us.ibm.com designates 32.97.182.144 as permitted sender) To: open-jpa-dev@incubator.apache.org MIME-Version: 1.0 Subject: Bug when persisting two related objects X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 Message-ID: From: Majeed Arni Date: Wed, 9 May 2007 20:52:14 -0500 X-MIMETrack: Serialize by Router on D01MLL83/01/M/IBM(Release 7.0.2FP1LinuxHF1|April 3, 2007) at 05/09/2007 21:52:15, Serialize complete at 05/09/2007 21:52:15 Content-Type: multipart/alternative; boundary="=_alternative 000A3995862572D7_=" X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 000A3995862572D7_= Content-Type: text/plain; charset="US-ASCII" I have 2 objects related, when I create both in a transaction and "set one object on another" and then committing. I get this error. The objects are stored in DB2 with auto increment -ing identity. "This error can also occur when a horizontally or vertically mapped classes uses auto-increment application identity and does not use a hierarchy of application identity classes." Caused by: <0.9.7-incubating fatal user error> org.apache.openjpa.persistence.ArgumentException: Attempt to assign id "com.XXX.core.pbo.Base-141" to new instance "com.XXXX.core.pbo.Project-com.XXXX.core.pbo.Base-141" failed; there is already an object in the L1 cache with this id. You must delete this object (in a previous transaction or the current one) before reusing its id. This error can also occur when a horizontally or vertically mapped classes uses auto-increment application identity and does not use a hierarchy of application identity classes. FailedObject: com.XXXXX.core.pbo.Project-com.XXXX.core.pbo.Base-141 at org.apache.openjpa.kernel.BrokerImpl$ManagedCache.commitNew( BrokerImpl.java:4528) at org.apache.openjpa.kernel.BrokerImpl.setStateManager( BrokerImpl.java:3787) at org.apache.openjpa.kernel.StateManagerImpl.commit( StateManagerImpl.java:925) at org.apache.openjpa.kernel.BrokerImpl.endTransaction( BrokerImpl.java:2194) at org.apache.openjpa.kernel.BrokerImpl.afterCompletion( BrokerImpl.java:1801) at org.apache.openjpa.kernel.LocalManagedRuntime.commit( LocalManagedRuntime.java:93) at org.apache.openjpa.kernel.BrokerImpl.commit( BrokerImpl.java:1311) at org.apache.openjpa.kernel.DelegatingBroker.commit( DelegatingBroker.java:866) at org.apache.openjpa.persistence.EntityManagerImpl.commit( EntityManagerImpl.java:409) Regards, Majeed Arni --=_alternative 000A3995862572D7_=--