-->
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: my NonUniqueObjectException should be handled...
PostPosted: Tue Jun 16, 2009 5:05 am 
Newbie

Joined: Thu Jun 12, 2008 10:52 am
Posts: 16
.. but it's not :D

Hi there !
Sometimes, at the time to saveOrUpdate one of my entity which has a collection, I can get a ConstraintViolationException because of a duplicate entry in that collection (trying to insert a tag that is already in the DB). It's okay, I'm handling any kind of HibernateException around this saveOrUpdate by rolling back the transaction then closing the session.
But the very next time I'm trying to re-saveOrUpdate my entity with a collection that is containing valid Tags, I'm getting a NonUniqueObjectException on my entity. Please note that I'm not getting this error if i'm trying to re-saveOrUpdate my entity with a collection which contains the original Tags.

So my question is, does closing the session should be enough or is there something that i'm missing ?

Thank you


Top
 Profile  
 
 Post subject: Re: my NonUniqueObjectException should be handled...
PostPosted: Wed Jun 17, 2009 5:35 pm 
Newbie

Joined: Thu Jun 12, 2008 10:52 am
Posts: 16
A little pushup :)


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.