Return-Path: Delivered-To: apmail-incubator-open-jpa-dev-archive@locus.apache.org Received: (qmail 30160 invoked from network); 10 May 2007 15:18:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 May 2007 15:18:55 -0000 Received: (qmail 87784 invoked by uid 500); 10 May 2007 15:19:02 -0000 Delivered-To: apmail-incubator-open-jpa-dev-archive@incubator.apache.org Received: (qmail 87753 invoked by uid 500); 10 May 2007 15:19:01 -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 81255 invoked by uid 99); 10 May 2007 15:15:11 -0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_10_20,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=sbcglobal.net; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=vvWlJ3iq09CCoLsiGjt83l6u6vEiUYh8u30nIz97DPvc+V6T5etN0mAeIZfUTBWgtS1t0cEeIwBXZb0uWyoJx9OYj5RsdYsFVp0ij4TmPWVA6Qla7vcIAyCVrxswB/swE0CTSs7p9UjjuK3FcklAvI+22S/bDHom8OS8V739n74=; X-YMail-OSG: 2WQAaDYVM1kJI7osmus4LguPJn4.s4r.AykVBdtJRxWgW2BtrtZJPiVA9cM8tG0tg_4oQztvDw-- Date: Thu, 10 May 2007 08:14:42 -0700 (PDT) From: Majeed Arni Subject: Error in persisting 2 related object in OpenJPA 0.9.7/DB2 To: open-jpa-dev@incubator.apache.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1840750096-1178810082=:84721" Content-Transfer-Encoding: 8bit Message-ID: <702045.84721.qm@web82510.mail.mud.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org --0-1840750096-1178810082=:84721 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit I am trying to save 2 objects which have 1-to-Many relationship. Both are created in a transaction and then persisted. Both have identity generated by DB2. Is this a bug? is there a workaournd this? Caused by: <0.9.7-incubating fatal store error> org.apache.openjpa.persistence.RollbackException: Attempt to assign id "com.testc.reporting.core.pbo.Base-201" to new instance "com.testc.reporting.core.pbo.Project-com.testc.reporting.core.pbo.Base-201" 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. at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:420) at com.testc.reporting.core.TestProject.testCreateProject(TestProject.java:54) at com.testc.reporting.core.TestProject.testProject(TestProject.java:24) at com.testc.reporting.core.Main.main(Main.java:19) ... 27 more Caused by: <0.9.7-incubating fatal user error> org.apache.openjpa.persistence.ArgumentException: Attempt to assign id "com.testc.reporting.core.pbo.Base-201" to new instance "com.testc.reporting.core.pbo.Project-com.testc.reporting.core.pbo.Base-201" 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.testc.reporting.core.pbo.Project-com.testc.reporting.core.pbo.Base-201 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) ... 30 more --0-1840750096-1178810082=:84721--