-->
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: Initializing lazy ends (proxies) from 2-level cache
PostPosted: Wed Aug 07, 2013 4:39 am 
Newbie

Joined: Thu Jan 13, 2005 4:04 am
Posts: 12
Location: Estonia
Hi, all

Is it some how possible to "intercept" loaded objects and replace lazy ends from 2-level cache. I have some heavy used domain entities that all are target of the 2-level cache. Instead of making associations to these entities eagerly fetched from referencing parent (through configuration) I would rather wish somehow to intercept loading of these parent objects and replace lazy proxies with ones obtained from 2-level cache (because eager fetching through configutation will result in actual sql executed towards to the DB (always JOIN entities that are already stored in 2-level cache) as well increased io between DB and AppServer - so this is last option I would use).

I tried to use Interceptor.onLoad by checking loaded state properties of given type from state array and was trying to initialize them from cache (session.get(class, id) that should first check sessionfac. level (2-level) cache) but this does not work - objects will remain proxies. And as I understand, it should not work because Interceptor contract very clearly states:

* The <tt>Session</tt> may not be invoked from a callback (nor may a callback cause a collection or proxy to
* be lazily initialized).<br>


But accessing 2-level cache is not possible without using session (as far as I know).

Does anybody know some alternative that will make me happy ;)?

Thank you!
Ilhan


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.