Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 81169 invoked from network); 1 Sep 2009 18:31:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Sep 2009 18:31:43 -0000 Received: (qmail 91276 invoked by uid 500); 1 Sep 2009 18:31:42 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 91202 invoked by uid 500); 1 Sep 2009 18:31:42 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 91192 invoked by uid 99); 1 Sep 2009 18:31:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Sep 2009 18:31:42 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.222.171] (HELO mail-pz0-f171.google.com) (209.85.222.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Sep 2009 18:31:31 +0000 Received: by pzk1 with SMTP id 1so193778pzk.3 for ; Tue, 01 Sep 2009 11:31:10 -0700 (PDT) Received: by 10.114.163.13 with SMTP id l13mr4891434wae.139.1251829870131; Tue, 01 Sep 2009 11:31:10 -0700 (PDT) Received: from brevsnb004 ([118.97.33.171]) by mx.google.com with ESMTPS id m34sm323223waf.29.2009.09.01.11.31.07 (version=SSLv3 cipher=RC4-MD5); Tue, 01 Sep 2009 11:31:09 -0700 (PDT) Reply-To: From: "C N Davies" To: References: <1251740936567-3555069.post@n2.nabble.com> <1251809726486-3560316.post@n2.nabble.com> <89c0c52c0909010632s6ee9f286rda4f27bc538b683c@mail.gmail.com> <004901ca2b2b$2aec5580$80c50080$@com> In-Reply-To: Subject: RE: How to persist then update in same transaction Date: Wed, 2 Sep 2009 02:30:59 +0800 Organization: C N Davies Pty Ltd Message-ID: <005001ca2b32$5ce0dc80$16a29580$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcorLNJISb9Emh3HR6a3rJqdRl7LBAAAO8ZA Content-Language: en-au X-Virus-Checked: Checked by ClamAV on apache.org Hi Daryl, I've moved one of my new apps to hibernate as I said I was going to, but I also have a smaller less time critical app I am still using OpenJPA for, this is the one where I see the behaviour described below. It's quite easy to reproduce, basically it works like this: Create an instance of the entity manager (1) and retrieve an "Invoice" Entity Create a new instance of the entity manager (2) and retrieve an "InvoiceLine" entity. The Invoice entity has a collection of InvoiceLine entities in a member named "lines", which is set to ManyToOne and cascade refresh. Now add this retrieved InvoiceLine to the Invoice "lines" collection in the Invoice entity. Close the entity manager (2) which should now make the InvoiceLine entity detached Now call merge on he Invoice entity using the first entity manager (1). It'll always complain that the Invoiceline entity is not managed by the context. Hope I explained that ok. Chris -----Original Message----- From: Daryl Stultz [mailto:daryl@6degrees.com] Sent: Wednesday, 2 September 2009 1:51 AM To: users@openjpa.apache.org Subject: Re: How to persist then update in same transaction On Tue, Sep 1, 2009 at 1:39 PM, C N Davies wrote: > What I find is Chris, I thought you and I were done trying to figure out if my error condition is the same as yours! I'm intrigued by this new information of yours. Can you provide a simple code sketch that illustrates the problem you are having? -- Daryl Stultz _____________________________________ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:daryl@6degrees.com