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.  [ 2 posts ] 
Author Message
 Post subject: different object with the same identifier
PostPosted: Mon Apr 10, 2006 5:06 pm 
Regular
Regular

Joined: Wed Sep 21, 2005 1:37 pm
Posts: 53
Location: Montpellier - France
Comment éviter les problèmes associés à cette exception ?
J'ai modifié les 'hashCode' et 'equals' pour utiliser la clé primaire et non l'objet lui même mais cela ne semble rien changer.

Hibernate version: 3.0.2

Full stack trace of any exception that occurs:
java.rmi.ServerException: EJBException:; nested exception is:
javax.ejb.EJBException: javax.ejb.FinderException: javax.transaction.TransactionRolledbackException: org.hibernate.HibernateException: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [UserBMP#5]; nested exception is:


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 25, 2006 8:15 am 
Regular
Regular

Joined: Sat May 15, 2004 4:27 am
Posts: 79
Tu peux supprimer de la session l'objet qui pose prb. J'avais ce genre d'erreur
lorsque j'essayais de ballader entre plusieurs couches des objets DTO ayant
la même identité que des pojos chargé dans des couches métiers.

Essaye un truc du genre :

hibernateCurrentSession().evict(mon_pojo);

Cela implique par la suite pour la mise à jour de l'objet il faille utiliser la méthode
update();

ps : si cette réponse est utilie merci de me donner un crédit


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.