wood burning stoves 2.0*
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
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

jQuery in Action, 2nd edition
subject: Hibernate Err:NonUniqueObjectException
Similar Threads
session is closed
Problem with inserting new data into database using hibernate
Unknown entity: java.util.ArrayList ???
Error on inserting a new record to table:
hibernate one-many example issue