-->
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.  [ 1 post ] 
Author Message
 Post subject: own LazyInitializer-Impl - planed? expedient?
PostPosted: Fri Nov 05, 2004 5:27 am 
Expert
Expert

Joined: Tue Oct 05, 2004 9:45 am
Posts: 263
Hibernate version: cvs_snapshot

Hi there,

i've had a look at the hibernate source concerning the handling of lazy-loading and proxies ... i haven't spent much time for it, but i think i have a low understanding how it works ...

Am i right, that the LazyInitializer will load the 'missing' entity in his 'initialize'-method and puts the result in the 'target'-variable?

For me, that would be a great point to do the following:
- add my own implementation (possible way is to configure what to use in the hbm.xml-file)
- don't use the Hibernate-Session directly, but use the same 'persistence-services' as i would use without a proxy (eg. if i want to load a person with id xy). Then there would be no need of 'ad-hoc' transaction- and session-handling in the proxy instead it would be the same as during 'normal' application-flow.
Eg. i wouldn't call "session.immediateLoad" but "persistenceManager.immediateLoad(..)" .. sure not such a big difference but if it would be then possible to add the parent of the lazy-loaded entity, i could open a new session, reattach the parent etc. ...
It also would be possible to use lazy-loading in distributed environments ... (depends on the implementation of the proxy)

Sure, my thoughts are at the beginning, and there're some points which propably won't really be easy ... but i like the idea ...

So my question is, if such a possibility to add my own Proxy-code is planed? Wanted? Expedient? Like written above the difference between my thoughts and the current implementation is not really big, but i think my thoughts are more fexible ...

Or is this approach completly nonsense? And if ... why?

thx!
curio


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

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.