From dev-return-6813-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Thu Nov 15 22:27:31 2007 Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 14685 invoked from network); 15 Nov 2007 22:27:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Nov 2007 22:27:31 -0000 Received: (qmail 456 invoked by uid 500); 15 Nov 2007 22:27:19 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 295 invoked by uid 500); 15 Nov 2007 22:27:18 -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 286 invoked by uid 99); 15 Nov 2007 22:27:18 -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 14:27:18 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 216.86.168.191 is neither permitted nor denied by domain of geir@pobox.com) Received: from [216.86.168.191] (HELO turtle-out.mxes.net) (216.86.168.191) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Nov 2007 22:27:06 +0000 Received: from mxout-03.mxes.net (mxout-03.mxes.net [216.86.168.178]) by turtle-in.mxes.net (Postfix) with ESMTP id 40EC31640E1 for ; Thu, 15 Nov 2007 16:54:08 -0500 (EST) Received: from 1023chost63.starwoodbroadband.com (unknown [12.37.185.63]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTP id 75DDA23E496 for ; Thu, 15 Nov 2007 16:52:07 -0500 (EST) Message-Id: From: "Geir Magnusson Jr." To: dev@openjpa.apache.org In-Reply-To: <3992B07C0590B548BB294D31768A1DA2A1288C@repbex01.amer.bea.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v912) Subject: Re: @PostPersist woes Date: Thu, 15 Nov 2007 16:52:05 -0500 References: <535E699A-DC3D-46AE-AF17-7652D0C59ABD@pobox.com> <3992B07C0590B548BB294D31768A1DA2A1287E@repbex01.amer.bea.com> <2730F200-F5BB-4BF9-B84E-99B3A129574F@pobox.com> <3992B07C0590B548BB294D31768A1DA2A1288C@repbex01.amer.bea.com> X-Mailer: Apple Mail (2.912) X-Virus-Checked: Checked by ClamAV on apache.org On Nov 15, 2007, at 4:45 PM, Pinaki Poddar wrote: > It is failing on an instance of InventoryItem.getId() -- is it itself > the argument of persist() or an instance navigable from it? This is where things get fun. InventoryItem is a baseclass of A and B and we're using Joined inheritance strategy. So yes, InventoryItem will be the arg to persist(). That said, see my next mail where I provide some detail... > > > If possible, try application set identity for InventoryItem, not the > provider. What does that mean? (I'm an openjpa newbie...) geir > > > > -----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.