Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 97906 invoked from network); 9 Feb 2011 11:28:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Feb 2011 11:28:22 -0000 Received: (qmail 6063 invoked by uid 500); 9 Feb 2011 11:28:22 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 5902 invoked by uid 500); 9 Feb 2011 11:28:19 -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 5894 invoked by uid 99); 9 Feb 2011 11:28:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Feb 2011 11:28:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Feb 2011 11:28:17 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 6F6A319B7CB for ; Wed, 9 Feb 2011 11:27:57 +0000 (UTC) Date: Wed, 9 Feb 2011 11:27:57 +0000 (UTC) From: "Mark Struberg (JIRA)" To: dev@openjpa.apache.org Message-ID: <1840572101.4884.1297250877438.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <7792970.116011294084185776.JavaMail.jira@thor> Subject: [jira] Commented: (OPENJPA-1912) enhancer generates invalid code if fetch-groups is activated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-1912?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12992441#comment-12992441 ] Mark Struberg commented on OPENJPA-1912: ---------------------------------------- omg, pretty heavy to find this issue. The reason why it used to work in the openjpa-persistence-jdbc test was due to the old persistende_1.0 schema! And in my regression test (as in my real world project) I use the version="2.0" of the persistence.xml schema I was able to run the regression test after adding Conclusio: there is a fish in our deserialisation logic because the DetachedStateManager doesn't create proxies for Collections, Maps, etc anymore... Question: which side effects does using IgnoreDetachedStateFieldForProxySerialization=true have? *shudder* > enhancer generates invalid code if fetch-groups is activated > ------------------------------------------------------------ > > Key: OPENJPA-1912 > URL: https://issues.apache.org/jira/browse/OPENJPA-1912 > Project: OpenJPA > Issue Type: Bug > Components: Enhance > Affects Versions: 2.0.0, 2.0.1, 2.1.0 > Reporter: Mark Struberg > Priority: Critical > Attachments: OPENJPA-1912-enhancer.patch, OPENJPA-1912-fix-wo_cleanup-2.patch, OPENJPA-1912-fix-wo_cleanup.patch, OPENJPA-1912-mdd.diff.txt, OPENJPA-1912-test.patch > > > If openjpa.DetachState =fetch-groups is used, the enhancer will add a 'implements Externalizable' + writeExternal + readExternal. > The problem is, that writeExternal and readExternal will also try to externalize the private members of any given superclass. Thus we get a runtime Exception that we are not allowed to access those fields. > Example: > @Entity > public abstract class AbstractGroup { > ... > @Temporal(TemporalType.TIMESTAMP) > @TrackChanges > private Date applicationBegin; > ... > } > and > @Entity > public class Group extends AbstractGroup { > ... > } > will result in the following code (decompiled with jad): > public void writeExternal(ObjectOutput objectoutput) > throws IOException > { > pcWriteUnmanaged(objectoutput); > if(pcStateManager != null) > { > if(pcStateManager.writeDetached(objectoutput)) > return; > } else > { > objectoutput.writeObject(pcGetDetachedState()); > objectoutput.writeObject(null); > } > objectoutput.writeObject(applicationBegin); > objectoutput.writeObject(applicationEnd); > objectoutput.writeObject(applicationLocked); > objectoutput.writeObject(approvalRequired); > ... -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira