Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 93626 invoked from network); 16 Sep 2009 21:12:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Sep 2009 21:12:35 -0000 Received: (qmail 46854 invoked by uid 500); 16 Sep 2009 21:12:35 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 46794 invoked by uid 500); 16 Sep 2009 21:12:35 -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 46781 invoked by uid 99); 16 Sep 2009 21:12:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Sep 2009 21:12:35 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [74.125.92.26] (HELO qw-out-2122.google.com) (74.125.92.26) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Sep 2009 21:12:23 +0000 Received: by qw-out-2122.google.com with SMTP id 3so1612550qwe.57 for ; Wed, 16 Sep 2009 14:12:02 -0700 (PDT) Received: by 10.224.6.10 with SMTP id 10mr7962726qax.60.1253135522116; Wed, 16 Sep 2009 14:12:02 -0700 (PDT) Received: from brevsnb004 ([118.97.33.171]) by mx.google.com with ESMTPS id 23sm2030316qyk.3.2009.09.16.14.11.59 (version=SSLv3 cipher=RC4-MD5); Wed, 16 Sep 2009 14:12:01 -0700 (PDT) Reply-To: From: "C N Davies" To: References: <001a01ca36fa$5cb17ca0$161475e0$@com> <001e01ca36fe$431fc8b0$c95f5a10$@com> <002201ca3704$577235e0$0656a1a0$@com> <002801ca370c$d53fbda0$7fbf38e0$@com> In-Reply-To: Subject: RE: SingleFieldManager crash Date: Thu, 17 Sep 2009 05:11:46 +0800 Organization: C N Davies Pty Ltd Message-ID: <002c01ca3712$4f93dd70$eebb9850$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Aco3D2C1/ifgWiNxRSicn4L8rxHOmwAAFD3A Content-Language: en-au X-Virus-Checked: Checked by ClamAV on apache.org Hi Daryl, It's been driving me nuts for a long time so thought it'd be worth understanding the issue since you are having it as well. One other thing I am not sure if you have checked or not (sorry if I missed it), I can get a similar issue if I have an entity in the attached field that for whatever reason has broken references to other entities. Since I am generally using REFRESH when attaching entities, when I persist/merge an entity, it basically walks down the entity relationships and is checking all the linked entities, not just the ones I am linking immediately. What I found before was that if one of those references was pointing to an entity that longer existed in the DB, the "detached" issue would effect the top level entity's ability to persist. Hard to explain, maybe I can draw it here: Company -> officeLocation -> Address -> Country Each of these are entities. If I go to persist/merge Company, officeLocation is refreshed which causes Address to refresh, which causes Country to refresh. If for example Country is no longer in the DB (it was attached to the address when it was in the DB), then attempting to save Company fails with a detached error. I also noticed that if I attach a null entity to my main entity, this null entity ends up being non-null inside the OpenJPA code (haven't worked out how or where yet) and is assigned an id, however the persist/merge will fail whether or not the DB allows a null in that column. Just a few little anomalies I see :) Regarding the Ant script, I am using eclipse and exported my project out to an ANT build file, I can hack that into shape if you can send me your enhancement step I am happy to stick it in and give it a shot. Chris -----Original Message----- From: Daryl Stultz [mailto:daryl@6degrees.com] Sent: Thursday, 17 September 2009 4:50 AM To: users@openjpa.apache.org Subject: Re: SingleFieldManager crash On Wed, Sep 16, 2009 at 4:32 PM, C N Davies wrote: > but in the case of the "supplier" entity > you saw in my stack trace, sm is returning null and hence throwing the > InvalidStateException. ... > So somewhere in the _broker.getStateManager() the wheels are falling > off. I'll dig deeper. > > That's my suspicion with my case but since I can't step through it, I can't be sure. Chris, you've been the only person to put forth serious effort to help me with this, presumably because you have a similar/same situation. I really appreciate your help. I would like to eliminate enhancement as a variable. I'll see if I can make an Ant file for you to add build-time enhancement. Are you using Eclipse? -- Daryl Stultz _____________________________________ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:daryl@6degrees.com