.. 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
|