Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 29066 invoked from network); 11 Jul 2009 06:06:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Jul 2009 06:06:20 -0000 Received: (qmail 22871 invoked by uid 500); 11 Jul 2009 06:06:29 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 22799 invoked by uid 500); 11 Jul 2009 06:06:29 -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 22789 invoked by uid 99); 11 Jul 2009 06:06:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Jul 2009 06:06:29 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.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; Sat, 11 Jul 2009 06:06:18 +0000 Received: from tervel.nabble.com ([192.168.236.150]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MPVif-0000i2-6J for users@openjpa.apache.org; Fri, 10 Jul 2009 23:05:57 -0700 Date: Fri, 10 Jul 2009 23:05:57 -0700 (PDT) From: coloradoflyer To: users@openjpa.apache.org Message-ID: <1247292357188-3241035.post@n2.nabble.com> In-Reply-To: References: <1247035380024-3224059.post@n2.nabble.com> Subject: Re: null values not updating MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: openjpa@parallelsw.com X-Virus-Checked: Checked by ClamAV on apache.org Hi Daryl, I added in a 'version' colum to the table, and get/set methods for Version and annotated it @Version @Version public int getVersion() { return _version; } public void setVersion(int version) { _version = version; } With these changes, the problem did not change. I got to thinking that the problem may be because the class I'm in is decorated with @MappedSuperclass. But that was not the issue either, when I moved into the subclass I got the same results. I did notice that the versions were changing as I updated the entity, but the null values never seemed to get picked up. Daryl Stultz wrote: > > On Wed, Jul 8, 2009 at 2:43 AM, coloradoflyer > wrote: > > I have struggled with this problem recently myself. I'm not a JPA expert. > It > may be that the problem lies in this line: > >> >> when I run the following code: >> ... the object is disconnected and retrieved from probably another >> entity >> manager. >> Range r = .... >> > > I found that if I instantiated an existing entity myself (like from a > direct > ResultSet traversal) or I cloned and existing entity I would get this > problem. The manual states that in this case (I think it was referring to > deserialization) it can't tell the difference between a null value an an > "unloaded" field. If you are in fact using an entity manager to get the > original instance and you don't leave the VM it should have a proper > detached state. Can you post a simple unit test that shows how you are > doing > things? > > -- > Daryl Stultz > _____________________________________ > 6 Degrees Software and Consulting, Inc. > http://www.6degrees.com > mailto:daryl@6degrees.com > > -- View this message in context: http://n2.nabble.com/null-values-not-updating-tp3224059p3241035.html Sent from the OpenJPA Users mailing list archive at Nabble.com.