Return-Path: Delivered-To: apmail-incubator-cayenne-user-archive@locus.apache.org Received: (qmail 96743 invoked from network); 3 Aug 2006 21:16:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Aug 2006 21:16:26 -0000 Received: (qmail 13939 invoked by uid 500); 3 Aug 2006 21:16:26 -0000 Delivered-To: apmail-incubator-cayenne-user-archive@incubator.apache.org Received: (qmail 13923 invoked by uid 500); 3 Aug 2006 21:16:26 -0000 Mailing-List: contact cayenne-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cayenne-user@incubator.apache.org Delivered-To: mailing list cayenne-user@incubator.apache.org Received: (qmail 13914 invoked by uid 99); 3 Aug 2006 21:16:26 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Aug 2006 14:16:26 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of mkienenb@gmail.com designates 72.14.214.201 as permitted sender) Received: from [72.14.214.201] (HELO hu-out-0102.google.com) (72.14.214.201) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Aug 2006 14:16:24 -0700 Received: by hu-out-0102.google.com with SMTP id 22so1597794hug for ; Thu, 03 Aug 2006 14:16:02 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=X2pAoG+F6EUMz8/hBjyNHG46w6kuDsVkEn40672oLqqEWMvi154naC9pkWdk1MOCxGDjfoM/kVxe1yDGgDNP4T+MFQ1gSKCCn3AJazR5YeQINmOPHUJ5IbXdcljqMO19WREixE4LQ2Mp3CNgc8vmnfHIGR/rD60074d3xdYv6aI= Received: by 10.78.183.15 with SMTP id g15mr1106392huf; Thu, 03 Aug 2006 14:16:02 -0700 (PDT) Received: by 10.78.170.1 with HTTP; Thu, 3 Aug 2006 14:16:02 -0700 (PDT) Message-ID: <8f985b960608031416w881bb26v32ad5c4ae8ce4824@mail.gmail.com> Date: Thu, 3 Aug 2006 17:16:02 -0400 From: "Mike Kienenberger" To: cayenne-user@incubator.apache.org Subject: Re: Null pointer exceptions and database null In-Reply-To: <8f985b960608031414p344cc404wf8225da32052947b@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <8f985b960608031403y55047550ta303a2cfc2bd2371@mail.gmail.com> <8f985b960608031414p344cc404wf8225da32052947b@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is also the piece of code you can modify to fit your definition of "want Cayenne not to modify the database unecessarily" by skipping setting any equivalent values. On 8/3/06, Mike Kienenberger wrote: > For JSF, it updates values even if the values haven't changed. So I > check for that condition and if so, I don't actually update anything. > > The safety issue is that DataObjects are only equal if it's the same > object in memory. So assigning another seemingly identical object > would sneak through. > > I eventually (last week) wrote a new equals() method for my > BaseDataObject class that makes DataObjects equal if their ObjectId > value is equal. I'm hoping that will do what I want, but I'm a bit > nervous about changing DataObject equality. > > > On 8/3/06, =D8yvind Harboe wrote: > > Super! > > > > > // TODO: needed for JSF > > > Object oldValue =3D readProperty(propName); > > > if (oldValue =3D=3D value) > > > { > > > // NOOP > > > return; > > > } > > > if (null !=3D oldValue) > > > { > > > if (oldValue.equals(value)) > > > { > > > // NOOP > > > // IMPLEMENT: not sure if this is safe! > > > > What does this comment mean? > > > > > > > > -- > > =D8yvind Harboe > > http://www.zylin.com > > >