-->
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: Lazy Field Interception
PostPosted: Thu Feb 09, 2006 8:22 pm 
Newbie

Joined: Tue Feb 07, 2006 8:17 pm
Posts: 19
What is the best way to intercept calls to initialise lazy fields?

The classes org.hibernate.intercept.FieldInterceptor and org.hibernate.intercept.LazyInitializer sound interesting but I'm not sure how to provide one of these - do I set some config or set some property on an object?

The background is that I am writing a swing app, utilising spring. I want to intercept a call to lazy fields so I can attach the session (I have a global session) to the current thread so it can hydrate the field.

thanks, Tom.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 09, 2006 9:05 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Have a read of http://www.hibernate.org/43.html on the downsides of your approach (especially the section "Why can't Hibernate just load objects on demand?"), and how to implement a better alternative.


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.