Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 23440 invoked from network); 1 May 2008 15:54:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 May 2008 15:54:56 -0000 Received: (qmail 51156 invoked by uid 500); 1 May 2008 15:54:57 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 51146 invoked by uid 500); 1 May 2008 15:54:57 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 51135 invoked by uid 99); 1 May 2008 15:54:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 May 2008 08:54:56 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mkienenb@gmail.com designates 72.14.214.226 as permitted sender) Received: from [72.14.214.226] (HELO hu-out-0506.google.com) (72.14.214.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 May 2008 15:54:10 +0000 Received: by hu-out-0506.google.com with SMTP id 28so677113hub.2 for ; Thu, 01 May 2008 08:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=mv3yU56Hy22fNlbfq2inPzJFJtdLUDKLcaU1WrY+5lI=; b=Kl//oyQXzy+7kWiyZw2nPeL0YdnRhzluV2dT6M/1fhNIepeEUNkkIWuzqezfDwH/Yahu62PJpSElGp0CK86+lfOycDBLgrPFnrFtUJXPnicraZ5GyLRTdGYdt3HylwmW1nyPIsahyPw7V6EFk53Tmvffrbqh3XBp9EqpB2BWJXw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=bOm6mTNYKnqPA2qkXH3j858BHmmoW0dHWQusfRVT5RA8O/Pr8IRhjLFuPGwjDDy+D4NUCZIhOyBxc7pL7dG1xyBGdVD9zKE+Gad3cmIvH3bbzenXjglkPhlc1GaqBgZb0GdVj3Z0nKnw5PHoyKAMqmUyw7eianVECS30VwOYbrE= Received: by 10.151.113.5 with SMTP id q5mr2423615ybm.135.1209657262282; Thu, 01 May 2008 08:54:22 -0700 (PDT) Received: by 10.151.79.17 with HTTP; Thu, 1 May 2008 08:54:22 -0700 (PDT) Message-ID: <8f985b960805010854m38840c84u42b87942a4ffcafa@mail.gmail.com> Date: Thu, 1 May 2008 11:54:22 -0400 From: "Mike Kienenberger" To: user@cayenne.apache.org Subject: Re: Does DataContext.rollbackChanges() in 1.1.4 leave transient objects in toManyList relationships? In-Reply-To: <16980077.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <8f985b960710101306m54b49529v64bdb8381d2ee112@mail.gmail.com> <8f985b960710110803n7cdbab23v1443ae65defad4e7@mail.gmail.com> <16980077.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org It's likely that it's the same bug that was found in Cayenne 1.1.4. There's no clean fix if that's the case. The workaround I originally posted was to force each object affected back to a fault so it'd be refetched on the next access with a cleaned up relationship list. Not sure how practical that is on a global basis. On 4/30/08, Alexis wrote: > > Hi, > > i have the same issue with Cayenne 2.0 : > Some objects are inserted and added in a commited object's to-many > relationship. > An exception occured, we rollback the changes but the new objects remain in > the to-many relationship > as transient objects ! > Is this a feature or a bug ? > Is there a clean workaround ? > > Thanks for your answers > > > > Mike Kienenberger wrote: > > > > Yeah, I hit this behavior in a unit test, but I wasn't sure if it was > > a Cayenne problem or something wrong that I did. > > > > This appears to fix the issue, although it's not really convenient: > > > > // Rollback changes may leave transient objects in toMany Lists. > > if (PersistenceState.COMMITTED == > > dataObject.getPersistenceState()) > > { > > dataObject.setPersistenceState(PersistenceState.HOLLOW); > > } > > dataObject.resolveFault(); > > > > > > > > I've been working on maintenance for a Cayenne 1.1 project for the > > last few months, and due to some local mods (custom local event > > bridge, custom propagation of invalidation events between snapshots, > > and other minor tweeks), trying to upgrade Cayenne isn't practical at > > this point. I did finally upgrade it from 1.1R2 to 1.1.4, though :-) > > > > On 10/11/07, Andrus Adamchik wrote: > >> Good question... Without looking at 1.1 source code, I'd say yes. But > >> I'd say running a test would be the best way to determine that. > >> (1.1.4? when was that? :-)) > >> > >> Andrus > >> > >> > >> On Oct 10, 2007, at 11:06 PM, Mike Kienenberger wrote: > >> > >> > Should I expect that DataContext.rollbackChanges() in 1.1.4 leave > >> > transient objects for new objects in toManyList relationships > >> > containing that new object? > >> > > >> > I'm pretty sure that the answer is yes. > >> > > >> > >> > > > > > > > -- > View this message in context: http://www.nabble.com/Does-DataContext.rollbackChanges%28%29-in-1.1.4-leave-transient-objects-in-toManyList-relationships--tp13143656p16980077.html > Sent from the Cayenne - User mailing list archive at Nabble.com. > >