• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A different object with the same identifier value was already associated with the session error

 
Dilshan De Silva
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my Spring hibernate application, When I try to insert same data twice throws above error.
In here I have 2 Entity classes organisation and division, mapped with 1:M relationship.
To save Org and division I used 2 UI's,1st save the orgs and then those orgs are load into drop down in division insert ui. So in there when I save for 1st time its work fine.But the 2nd attempt with the same data gives above error.I used sequence properly.
Divition add method :


Organisation Entity :


Divition Entity :

My DAO save method Use saveorupdate.(I tried merge it didn't work either)
Anyone who knows what went wrong in code?
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the entire exception stacktrace.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic