• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate Err:NonUniqueObjectException

 
Abiodun Adisa
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 495
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was able to resolve this by calling clear on the session after each save

getSession().clear
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!