Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 80251 invoked from network); 25 Aug 2007 14:12:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Aug 2007 14:12:00 -0000 Received: (qmail 31942 invoked by uid 500); 25 Aug 2007 14:11:56 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 31913 invoked by uid 500); 25 Aug 2007 14:11:55 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 31904 invoked by uid 99); 25 Aug 2007 14:11:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Aug 2007 07:11:55 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Aug 2007 14:11:50 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7FBC271417D for ; Sat, 25 Aug 2007 07:11:30 -0700 (PDT) Message-ID: <19208775.1188051090497.JavaMail.jira@brutus> Date: Sat, 25 Aug 2007 07:11:30 -0700 (PDT) From: "Kevin Sutter (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Created: (OPENJPA-337) Throw an exception on access to unloaded fields in detached objects MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Throw an exception on access to unloaded fields in detached objects ------------------------------------------------------------------- Key: OPENJPA-337 URL: https://issues.apache.org/jira/browse/OPENJPA-337 Project: OpenJPA Issue Type: Improvement Components: jpa Affects Versions: 0.9.7 Reporter: Kevin Sutter Due to the Hibernate -> OpenJPA migration article in this month's devWorks, Patrick and I discussed a couple of alternatives to returning nulls on unloaded fields on detached objects: (http://www.ibm.com/developerworks/websphere/techjournal/0708_vines/0708_vines.html?ca=drs-) >From the article: "It is also worth noting that Hibernate and OpenJPA differ in accessing a lazy loaded collection from a detached object. In Hibernate, an exception will be thrown if the programmer attempts to access a lazy loaded collection on a detached object; while OpenJPA will return a null value, not an exception." Patrick's response: Actually, this depends on the openjpa.DetachedState setting. If appropriately configured, OpenJPA will throw on any unloaded field access when detached. The downside is that it changes the serialization footprint of the class. Also, I just thought of a way for us to throw exceptions for collection access even when not using that setting -- we could put Collection / Map impls into place that just throw when any method is invoked. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.