-->
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: An interceptor or event for proxy initialization?
PostPosted: Thu Jul 27, 2006 1:06 pm 
Newbie

Joined: Mon Aug 15, 2005 2:00 pm
Posts: 19
Ok, some background info first. I'm currently implementing a set of interceptors to handle field-level audit for persistent objects. There is an interceptor for onLoad, which stores object's initial state, and interceptors for onSave, onFlushDirty, and onDelete, which compare object's new state with the initial one, and construct audit trail based on the differences.

The problem I've encountered is that this setup doesn't quite work with the Open Session in View pattern. Since lazy-loaded properties are not yet loaded during the onLoad event, their inital state cannot be captured, and no proper audit trail could be constructed.

The workaround for collection-based lazy properties was simple - there's an event called InitializeCollectionEvent, which fires at the time collection is loaded, allowing me to capture its initial state at that time. However, this event is not fired for any property that is not a collection - like a lazy-loaded BLOB, or formula column, etc.

So, my question is, then - is there a way to intercept the event of loading a non-collection lazy property?

Thanks in advance,

Alex


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 01, 2006 10:56 am 
Newbie

Joined: Mon Aug 15, 2005 2:00 pm
Posts: 19
Umm... I'm surprised that even Hibernate people couldn't answer this one... I thought I phrased the question clear enough. Please, if there's any clarification needed - I'm still here.


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.