-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Entity copy exceptions with NaturalId entities
PostPosted: Thu Jul 04, 2013 2:00 pm 
Pro
Pro

Joined: Wed Nov 05, 2003 7:22 pm
Posts: 211
Hi,

I'm noticing issues in a code base where we applied naturalid and naturalid cache to a number of entities.

We're seeing these kinds of exceptions when we try to attach detached copies of these entities to a field with cascade=CascadeType.MERGE. Wondering if others see the same issue?

Code:
java.lang.IllegalStateException: Error occurred while storing entity [Nederland]. An entity copy [nl.project.model.location.Country#8] was already assigned to a different entity [nl.project.model.location.Country#8].
   at org.hibernate.event.internal.EventCache.put(EventCache.java:192)
   at org.hibernate.event.internal.DefaultMergeEventListener.entityIsDetached(DefaultMergeEventListener.java:285)
   at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:151)
   at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:924)
   at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:906)
   at org.hibernate.engine.spi.CascadingAction$6.cascade(CascadingAction.java:288)
   at org.hibernate.engine.internal.Cascade.cascadeToOne(Cascade.java:388)
   at org.hibernate.engine.internal.Cascade.cascadeAssociation(Cascade.java:331)
   at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:209)
   at org.hibernate.engine.internal.Cascade.cascadeComponent(Cascade.java:309)
   at org.hibernate.engine.internal.Cascade.cascadeProperty(Cascade.java:220)
   at org.hibernate.engine.internal.Cascade.cascade(Cascade.java:166)
   at org.hibernate.event.internal.AbstractSaveEventListener.cascadeBeforeSave(AbstractSaveEventListener.java:424)
   at org.hibernate.event.internal.DefaultMergeEventListener.entityIsTransient(DefaultMergeEventListener.java:213)
   at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:154)
   at org.hibernate.event.internal.DefaultMergeEventListener.onMerge(DefaultMergeEventListener.java:76)
   at org.hibernate.internal.SessionImpl.fireMerge(SessionImpl.java:914)
   at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:898)
   at org.hibernate.internal.SessionImpl.merge(SessionImpl.java:902)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.