Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Error:different object with the same identifier value was already associated with session

 
Murali Sridhar
Ranch Hand
Posts: 44
Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

We tried to simulate the hibernate error in DEV and QA environments, but no luck. If I didn't re-produce the problem in DEV and QA, there is no point of 'fix' in production.

Here is the error message: ERROR webServiceMessageCall - "nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session:"

I found some fixes by googling, but these are not helpful in re-producing the Hibernate error in DEV/QA environment.

Here is the simple hbm file:

** The AccKey is a simple bean.
Java code causing error:

Much appreciate your help in re-generating this problem in DEV.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like your list of objects contains two entries that equate to the same thing. Can you post your key implementation code?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic