Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 49587 invoked from network); 24 Mar 2009 13:48:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Mar 2009 13:48:04 -0000 Received: (qmail 47364 invoked by uid 500); 24 Mar 2009 13:48:03 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 47347 invoked by uid 500); 24 Mar 2009 13:48:03 -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 47336 invoked by uid 99); 24 Mar 2009 13:48:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Mar 2009 13:48:03 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.78.103.231] (HELO vorsha.objectstyle.org) (208.78.103.231) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 24 Mar 2009 13:47:57 +0000 Received: (qmail 23180 invoked from network); 24 Mar 2009 13:47:34 -0000 Received: from unknown (HELO ?IPv6:::1?) (127.0.0.1) by localhost with SMTP; 24 Mar 2009 13:47:34 -0000 Message-Id: From: Andrus Adamchik To: user@cayenne.apache.org In-Reply-To: <5adb61290903240636y50314e89u537573e44132eeb9@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: Any way to check if object has really changed? Date: Tue, 24 Mar 2009 15:47:32 +0200 References: <3219fff70903240316o4644e474ia669ea819510ef9f@mail.gmail.com> <5adb61290903240636y50314e89u537573e44132eeb9@mail.gmail.com> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org I think Andrey wants to do the opposite (??) - detect "phantom" changes that transfer an object to the MODIFIED state, but do not result in a DB record update. Andrus On Mar 24, 2009, at 3:36 PM, Michael Gentry wrote: > Well, the Artist object didn't really change. Could you override > Artist's addToPaintings() (don't forget to call super) and record > somewhere that a change has been made? > > mrg > > > On Tue, Mar 24, 2009 at 6:16 AM, Andrey Razumovsky > wrote: >> Imagine you have Artist and Painting entities. You create a new >> Paining and >> attach it to existing Artist, then commit. The Artist object is >> marked as >> modified, so LifecycleListeners will fire for it, but in fact nothing >> changed in DB table (ARTIST). Is there any way to check if object >> has really >> changed? I suppose I could iterate through all attrs and simple to- >> one rels >> during lifecycle event, and compare values with cached snapshot of >> the CDO, >> but this seems to be an ugly way.. >> >> Thanks, >> Andrey >> >