Joined: Thu Sep 03, 2009 10:24 pm Posts: 1
|
Hi
I do a Session.lock() on a collection of detached objects to attach them to the current session. The objects have a many-to-one association chain of objects with cascade="lock". Upon Session.lock() I get a
org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session
It seems that Hibernate creates different proxies for the same object.
I wonder if that's the expected behaviour or whether there is something going wrong.
As a work-around I pre-initialize the object and the proxy chain with Session.initialize(). Re-attaching the object to the current session through Session.lock() then seems to work.
Any thoughts?
Cheers,
Felix
|
|