aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Err:NonUniqueObjectException" Watch "Hibernate Err:NonUniqueObjectException" New topic
Author

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

getSession().clear
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate Err:NonUniqueObjectException
 
Similar Threads
session is closed
Problem with inserting new data into database using hibernate
Error on inserting a new record to table:
hibernate one-many example issue
Unknown entity: java.util.ArrayList ???