Return-Path: X-Original-To: apmail-geronimo-dev-archive@www.apache.org Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0025F10669 for ; Mon, 1 Jul 2013 18:10:28 +0000 (UTC) Received: (qmail 64480 invoked by uid 500); 1 Jul 2013 18:10:28 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 64141 invoked by uid 500); 1 Jul 2013 18:10:24 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 63825 invoked by uid 99); 1 Jul 2013 18:10:22 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Jul 2013 18:10:22 +0000 Date: Mon, 1 Jul 2013 18:10:22 +0000 (UTC) From: "Anthony Insolia (JIRA)" To: dev@geronimo.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (GERONIMO-6474) Reactivated/Reloaded Entity Bean not restoring UUID. UUID is correct upon construction and is correct in the RDB. 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/GERONIMO-6474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13697030#comment-13697030 ] Anthony Insolia commented on GERONIMO-6474: ------------------------------------------- This problemis easily reproducable with the change of one line of code: If @SessionScoped is changed to @ViewScoped the problem occurs. > Reactivated/Reloaded Entity Bean not restoring UUID. UUID is correct upon construction and is correct in the RDB. > ----------------------------------------------------------------------------------------------------------------- > > Key: GERONIMO-6474 > URL: https://issues.apache.org/jira/browse/GERONIMO-6474 > Project: Geronimo > Issue Type: Bug > Security Level: public(Regular issues) > Components: OpenEJB > Affects Versions: 3.0.0 > Environment: Apache Geronimo 3.0 > Apache Myfaces > Primefaces > MySQL > Reporter: Anthony Insolia > > I have a User class with an @OneToOne relationship to a Desktop class > User->Desktop > @Entity > @Table(name="user_table") > @Unique(members={"name"}) > @ManagedBean(name = "User") > @RequestScoped > public class User extends Element_ implements Serializable { > @Id > private long uuid = 0; > @OneToOne(targetEntity=Folder.class,cascade=CascadeType.ALL) > @MapsId > private Folder desktop = null; > ... > I was trying to save the User and their desktop and JPA informed me that the UUID at the superclass level didn't match the UUID at the subclass level. > Here is some println's from a method in User market @PostLoad to see what the desktop UUID's are: > User (snoop) is looking at the desktop with THIS 0 > User (snoop) is looking at the desktop with SUPER 429823953 > 'snoop' is the name of the @PostLoad method in my User class > I tried to repair the UUID as a work around but it causes an exception: > org.apache.openjpa.util.InvalidStateException: Attempt to change a primary key field of a > n instance that already has a final object id. Only new, unflushed instances whose id you have not retrieved can have their primary keys cha > nged. > I saw the same probelm in another area of my code where the UUID was correct and then zero'ed. This problem seems to be directly attributable to the fact that a view controller is defined as @ViewScoped. I don't see the problem when I change the controller to @SessionScoped. > Not sure what is going on here but these UUID's are getting zero'ed by someone/something/somecode both before getting stored and after reactivation. I am fairly confident that this is not my code that is causing the problem b/c I've tried to explcitiy update the UUID's but Geronimo won't let me b/c they have been made final by Geronimo. > FYI I am using the TABLE_PER_CLASS model -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira