I am having 2 tables A and B, where B is the child of A, also there is relation ship between B and B
Scenario:
a is the record in A
b1,b2 are the records in B
b1 and b2 are children of a,
also b2 is children of b1.
I have coded such that,
if A is updated -> its child B has to be updated ->child B of B has to be updated
when I try to update a, it updates b1 first, and since b2 is child of b1, b2 will get updated.
in next iteration, b2 will be getting updated since b2 is the child a, at this point of time I am getting "org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session" this error, since b2 already got loaded into session when b1 is updated, but when a tries to update b2, i m getting this error.
Please help me how can I solve this issue... plese let me know if you need more information.
Thanks in advance
|