Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 56379 invoked from network); 14 Apr 2010 13:49:14 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Apr 2010 13:49:14 -0000 Received: (qmail 98599 invoked by uid 500); 14 Apr 2010 13:49:14 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 98483 invoked by uid 500); 14 Apr 2010 13:49:14 -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 98475 invoked by uid 99); 14 Apr 2010 13:49:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Apr 2010 13:49:14 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kwsutter@gmail.com designates 209.85.212.46 as permitted sender) Received: from [209.85.212.46] (HELO mail-vw0-f46.google.com) (209.85.212.46) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Apr 2010 13:49:08 +0000 Received: by vws18 with SMTP id 18so62492vws.33 for ; Wed, 14 Apr 2010 06:48:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:content-type; bh=jcE+Q2mft/A0ud8Oh83fCn+QeMJP7NFTrBAlqv/aScw=; b=WeWsvikVR5L2wcpos8ui2e9SufOhybJ+9RsgCf8o0c2vdA2+6UhQoywTMGhPLCCwnb BNfvyhO5kz9Q5Qva8zh9hvr2AAzrchE3fOHU3Q0t+IaylP5w3isLvqE+z73pyZQTjBWm EccKo0DYZVxozv5vY0nRedHiCMzUXlRJroT8g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=UK4c7NfVOyBrt8+RgtpnzNVdsF1D9cnfRREMWSjkzkifj5tdKNlg9sR/C4eSHpOACo cKrhWJQR6Z4g3T7x0WJQEOEoNPwBm0s5BdYTo9W1zdV5rwXg/XO1J/2+NHBqJVrYfvtv 5rnHsafcSKiWtkFfgS9B7KD3rpaGdz1JUIaPc= MIME-Version: 1.0 Received: by 10.220.75.196 with HTTP; Wed, 14 Apr 2010 06:48:46 -0700 (PDT) In-Reply-To: <1271185721959-4897872.post@n2.nabble.com> References: <1271094970810-4891679.post@n2.nabble.com> <1271185721959-4897872.post@n2.nabble.com> Date: Wed, 14 Apr 2010 08:48:46 -0500 Received: by 10.220.108.27 with SMTP id d27mr4047806vcp.112.1271252927004; Wed, 14 Apr 2010 06:48:47 -0700 (PDT) Message-ID: Subject: Re: Problem of partial commit in OpenJPA From: Kevin Sutter To: users@openjpa.apache.org Content-Type: multipart/alternative; boundary=00c09f8de4f0224246048432a3ff X-Virus-Checked: Checked by ClamAV on apache.org --00c09f8de4f0224246048432a3ff Content-Type: text/plain; charset=ISO-8859-1 On Tue, Apr 13, 2010 at 2:08 PM, Ravi P Palacherla < ravi.palacherla@oracle.com> wrote: > > Kevin, > > In sudhir's code snippet, aDepartment is persisted and > aDepartment.getName() > is used in the find. > I guess aDepartment will be managed after the persist statement and the > find will always return a non-null object. So, I think that newDept should > never be null. > > Is my understanding incorrect ? > Ravi, Right. I couldn't quite figure out under what conditions a non-null department would be returned. But, since the Department entity wasn't provided, maybe the key generation had some anomaly that caused a problem with the find operation. Not sure. I decided to just focus on the partial commit problem rather than the app itself... :-) Related to that though is the final persist() call in the sample app. If newDept was found, then it is already managed by the persistence context. And, since it was already an existing entity, it doesn't make any sense to be performing a persist() operation. This should actually result in an EntityExistsException. Even a merge() in this case would not be necessary since the entity is already merged. So, maybe there are more issues with the app that need to resolved... Kevin > > Regards, > Ravi. > -- > View this message in context: > http://n2.nabble.com/Problem-of-partial-commit-in-OpenJPA-tp4891679p4897872.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. > --00c09f8de4f0224246048432a3ff--