Forums Register Login

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

+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
Please post the entire exception stacktrace.
Not so fast naughty spawn! I want you to know about
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 3459 times.
Similar Threads
How to lookup a EJB 3 session bean from a servlet?
Sequence increment does not match its pre-allocation size.
jpa problem
Persisting Entity with composite key is not working
Mapping with Multiple Entities
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:54:02.