From dev-return-6811-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Thu Nov 15 21:45:52 2007 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 769 invoked from network); 15 Nov 2007 21:45:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Nov 2007 21:45:52 -0000 Received: (qmail 48042 invoked by uid 500); 15 Nov 2007 21:45:39 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 47887 invoked by uid 500); 15 Nov 2007 21:45:39 -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 47878 invoked by uid 99); 15 Nov 2007 21:45:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2007 13:45:39 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ppoddar@bea.com designates 66.248.192.39 as permitted sender) Received: from [66.248.192.39] (HELO repmmg02.bea.com) (66.248.192.39) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2007 21:45:29 +0000 Received: from repmmr02.bea.com (repmmr02.bea.com [10.160.30.72]) by repmmg02.bea.com (Switch-3.3.0/Switch-3.2.7) with ESMTP id lAFLjMt7027354 for ; Thu, 15 Nov 2007 13:45:22 -0800 Received: from repbex01.amer.bea.com (repbex01.bea.com [10.160.26.98]) by repmmr02.bea.com (Switch-3.3.0/Switch-3.2.7) with ESMTP id lAFLjKPo026166 for ; Thu, 15 Nov 2007 13:45:20 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: RE: @PostPersist woes Date: Thu, 15 Nov 2007 13:45:19 -0800 Message-ID: <3992B07C0590B548BB294D31768A1DA2A1288C@repbex01.amer.bea.com> In-Reply-To: <2730F200-F5BB-4BF9-B84E-99B3A129574F@pobox.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: @PostPersist woes Thread-Index: Acgn0F8CXsBhfqR3SBegrgUoUjUZzAAAB8Cg References: <535E699A-DC3D-46AE-AF17-7652D0C59ABD@pobox.com> <3992B07C0590B548BB294D31768A1DA2A1287E@repbex01.amer.bea.com> <2730F200-F5BB-4BF9-B84E-99B3A129574F@pobox.com> From: "Pinaki Poddar" To: x-BEA-PMX-Instructions: AV x-BEA-MM: Internal-To-External X-Virus-Checked: Checked by ClamAV on apache.org It is failing on an instance of InventoryItem.getId() -- is it itself the argument of persist() or an instance navigable from it? If possible, try application set identity for InventoryItem, not the provider. -----Original Message----- From: Geir Magnusson Jr. [mailto:geir@pobox.com] Sent: Thursday, November 15, 2007 1:41 PM To: dev@openjpa.apache.org Subject: Re: @PostPersist woes On Nov 15, 2007, at 4:34 PM, Pinaki Poddar wrote: >> persist() has in it a new, unmanaged entity. > > a) If persist(a) is failing on b, what is the cascade type specified > on relation a.b? I'm not actually sure that it's failing on b. I guess I can try to figure that out. I just know that when I change things so that I have an unmanaged b, it fails. > > b) what is the identity definition on b? > c) if b is using auto-assigned GeneratedValue or its id is being set > by application? > > -----Original Message----- > From: Geir Magnusson Jr. [mailto:geir@pobox.com] > Sent: Thursday, November 15, 2007 11:10 AM > To: dev@openjpa.apache.org > Subject: @PostPersist woes > > Woe is me :) > > I'm using @PostPersist to create some kind of machine-generated data > for entities on insert, and I'm running into the following problem > when an entity for which I called persist() has in it a new, unmanaged > entity. > > [junit-coverage] Caused by: error> org.apache.openjpa.util.InvalidStateException: Detected > reentrant flush. Make sure your flush-time instance callback methods > or event listeners do not invoke any operations that require the in- > progress flush to complete. > [junit-coverage] at > org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1840) > [junit-coverage] at > org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1615) > [junit-coverage] at > org > .apache > .openjpa.kernel.StateManagerImpl.assignObjectId(StateManagerImpl.java: > 505) > [junit-coverage] at > org > .apache > .openjpa.kernel.StateManagerImpl.assignField(StateManagerImpl.java: > 590) > [junit-coverage] at > org > .apache > .openjpa > .kernel.StateManagerImpl.beforeAccessField(StateManagerImpl.java:1451) > [junit-coverage] at > org > .apache > .openjpa.kernel.StateManagerImpl.accessingField(StateManagerImpl.java: > 1434) > [junit-coverage] at > com.joost.model.InventoryItem.getId(InventoryItem.java) > [junit-coverage] at > com.joost.model.InventoryItem.initPublicIdIfNull(InventoryItem.java: > 331) > > > in InventoryItem, getId is the PK, and my read of the spec says that I > am guaranteed to have it in @PostPersist. > > Bug? me doing something wrong? > > geir > > > Notice: This email message, together with any attachments, may > contain information of BEA Systems, Inc., its subsidiaries and > affiliated entities, that may be confidential, proprietary, > copyrighted and/or legally privileged, and is intended solely for > the use of the individual or entity named in this message. If you > are not the intended recipient, and have received this message in > error, please immediately return this by email and then delete it. Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.