i have two objects that are connected (say object A can have reference to object B)
i pass both these objects from higher layer into hibernate-enabled layer
I do not know has A reference to B or has not, so i session.lock() both these
objects.
locking A object cascade locking B if there is reference, and lock only A if there no reference.
locking B after that causes NonUniqueObjectException if there was reference.
how can i overcome this? i do not know is there reference, so i can not selectevly lock only A.
|