I get hibernate exception “illegally attempted to associate a proxy with two open Sessions”. I tried many wayto resolve this issue but could not find any solutions.
Scenario which I follow is as below:
• Hibernate transaction is stated
• I create new instance of class A
• Load object from DB using HB session, and associates them to newly created instance of A
• Now I create new hibernate transaction and try to save instance of A, on hibernate save here it throws “illegally attempted to associate a proxy with two open Sessions”
Can anyone please suggest way to get out of this HB exception?
Note: I really need to save instance of A into separate transaction then where I created instance of A and loaded it’s associated instances.