geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anthony Insolia (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GERONIMO-6474) Reactivated/Reloaded Entity Bean not restoring UUID. UUID is correct upon construction and is correct in the RDB.
Date Wed, 26 Jun 2013 19:19:19 GMT

    [ https://issues.apache.org/jira/browse/GERONIMO-6474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13694177#comment-13694177
] 

Anthony Insolia commented on GERONIMO-6474:
-------------------------------------------

I tried switch inheritance models (to JOINED) because I thought that might solve this problem
temporarily. But that results in this exception when I try starting up my application:

<openjpa-2.1.1-r422266:1148538 fatal general error> org.apache.openjpa.persistence.PersistenceException:
Too many tables; MySQL can only use
61 tables in a join {prepstmnt 5731722 SELECT ........
                
> 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 <uuid> 0
> User (snoop) is looking at the desktop with SUPER <uuid> 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:
> <openjpa-2.1.1-r422266:1148538 nonfatal user error> 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

Mime
View raw message