I am facing the following error:
org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session
I have the following scenario:
I have a object A1 of type ClassA which contains 2 objects:
1) B1 of type ClassB
2) A2 of type ClassA again
Now A2 contains the same instance B1 in it also.
So whenever i invoke saveOrUpdate method for A1, i get the exception saying B1 is already associated with the session.
How do i save this object graph?
Thank you.
|