-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: two connected objects session.lock()
PostPosted: Tue Jan 25, 2005 4:54 am 
Regular
Regular

Joined: Fri Dec 17, 2004 10:38 am
Posts: 54
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 25, 2005 6:21 am 
Regular
Regular

Joined: Fri Dec 17, 2004 10:38 am
Posts: 54
i have found one solution in FAQ Hibernate throws: Another object was associated with this id
but this one does not satisfy me, since i have no reference on persistant instance of B at the time i lock B to evict() it, and saveOrUpdateCopy() returns reference on persistant instance and does not update argument but i can not update my B reference either.

are there other ways?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.