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
|
|