-->
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: Session.lock() and cascade
PostPosted: Mon Oct 13, 2003 12:07 pm 
Beginner
Beginner

Joined: Tue Sep 02, 2003 9:28 pm
Posts: 25
It looks like the lock call on an object only cascades to its associated objects when cascade is set to "all". I'm using the lock method with LockMode.NONE to re-associate objects retrieved in previous Hibernate Session with subsequent Hibernate Sessions to allow the AuditInterceptor interface to see the previous values for these objects. (I'm using an AuditInterceptor to perform auditing and it needs to record both the previous and new value on an update.) Ideally, I'd like to have the entire object graph re-associated with the new Hibernate Session when I call lock() no matter what the cascade rule is. Is there a way to do this?

One thought I had was to write my own lock() method using reflection that would recursively call lock on all properties and collections that are Hibernate entities. Any down side to doing this?

Thanks,

-Jay


btw - I'm using 2.1b4


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 22, 2004 2:36 pm 
Regular
Regular

Joined: Tue Dec 02, 2003 6:25 pm
Posts: 61
Location: Dallas, TX
How did you end up resolving this? I have just encountered the same problem trying to lock an object graph in a web application. I have also considered writing my own recursive lock utility.


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.