-->
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.  [ 3 posts ] 
Author Message
 Post subject: org.hibernate.NonUniqueObjectException
PostPosted: Thu Feb 26, 2009 6:21 am 
Newbie

Joined: Thu Feb 26, 2009 12:50 am
Posts: 3
Hi All,

During a transaction i call entityManager.merge(<a entity class>), that time i get the below error. Can someone throw light on how to avaoid this error or reason behind this.

Thanks
-Vijay

------------------------------------------------------------------------------


[Error] netxoffice.distworkflow.XlobSessionJPAService received unexpeced exception javax.persistence.PersistenceException: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session:
javax.persistence.PersistenceException: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [netxoffice.distworkflow.entity.XlDocument#netxoffice.distworkflow.entity.XlDocument@2f]
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:630)
at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:237)
at netxoffice.distworkflow.service.beans.XlobSessionJPAService.storeCollection(XlobSessionJPAService.java:550)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 26, 2009 7:42 am 
Newbie

Joined: Fri Jan 30, 2009 6:31 am
Posts: 13
Location: Bucharest/Romania
you probably have a one to many with a composite primary key in the Child class. the error comes from the fact that the same primary key is already used for a different child object of the same parent.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 27, 2009 4:40 am 
Newbie

Joined: Thu Feb 26, 2009 12:50 am
Posts: 3
i use only one class called XlDocument. However i tried using org.hibernate.Session.saveOrUpdate( xlDocument ). It worked without any errors. any reason?

-Thanks
-vijay


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

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.