This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate Err:NonUniqueObjectException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Err:NonUniqueObjectException" Watch "Hibernate Err:NonUniqueObjectException" New topic

Hibernate Err:NonUniqueObjectException

Abiodun Adisa
Ranch Hand

Joined: Jan 17, 2002
Posts: 495
I am using Hiberante to save data to my Database , I am trying to save two objects having the same values into the database, that is i don't mind having duplicates, any time i run the code below

and the exception i am getting is

any Suggestion would be welcome
Abiodun Adisa
Ranch Hand

Joined: Jan 17, 2002
Posts: 495
I was able to resolve this by calling clear on the session after each save

I agree. Here's the link:
subject: Hibernate Err:NonUniqueObjectException
jQuery in Action, 3rd edition