Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 34313 invoked from network); 10 Mar 2009 07:24:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Mar 2009 07:24:48 -0000 Received: (qmail 38357 invoked by uid 500); 10 Mar 2009 07:24:48 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 38327 invoked by uid 500); 10 Mar 2009 07:24:48 -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 38316 invoked by uid 99); 10 Mar 2009 07:24:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Mar 2009 00:24:48 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists+1214986160035-208411@n2.nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Mar 2009 07:24:40 +0000 Received: from tervel.nabble.com ([192.168.236.150]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LgwK3-0000jg-Op for users@openjpa.apache.org; Tue, 10 Mar 2009 00:24:19 -0700 Message-ID: <1236669859760-2453664.post@n2.nabble.com> Date: Tue, 10 Mar 2009 00:24:19 -0700 (PDT) From: Pinaki Poddar To: users@openjpa.apache.org Subject: Re: Issue in Handling persistent objects across multiple persistence contexts In-Reply-To: <1236609647831-2449327.post@n2.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: ppoddar@apache.org References: <1236609647831-2449327.post@n2.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi, OpenJPA uses a series of decisions to determine whether a given argument x as in merge(x) is a detached instance of not. The most obvious of this decisions is based on a version field in the entity. So the first suggestion will be to add a @Version field, if it is not defined already. If OpenJPA is inserting the merge entity, most likely that it has no version field and no detached state (another mechanism OpenJPA uses that adds few extra bits in the detached version of the instance). -- View this message in context: http://n2.nabble.com/Issue-in-Handling-persistent-objects-across-multiple-persistence-contexts-tp2449327p2453664.html Sent from the OpenJPA Users mailing list archive at Nabble.com.