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: Manipulating 2nd level cache
PostPosted: Wed May 25, 2005 3:59 pm 
Newbie

Joined: Fri Feb 11, 2005 1:27 pm
Posts: 5
I am using Hibernate 2.1 with TreeCache & Spring. I have no problem using the 2nd level cache for the persistent objects (TreeCache) but right now I want to make use of the same cache "runtime" for caching of some non-persistent objects.
There are several reasons for this, the primary ones being that I want a central place for configuring the cache/cache regions (treecache.xml) and I don't want to have two TreeCache instances in the same VM (if I were to instantiate a new TreeCache object, that would be the case. Same case will in fact be forced if the non-persistent object cache that I talk about will take place in a different VM than hibernate's VM). I know that the discussion can get more complicated if one thinks about layering and horizontal decoupling but from the caching perspective I don't see a semantic difference between persistent/non persistent objects.

I have found an interesting article (http://www.theserverside.com/articles/a ... ingWithAOP) but I still need to know whether is any way to obtain a reference to the current 2nd level cache provider object (I'm thinking of something similar to org.apache.log4j.Logger.getLogger(...) which will use the current logging context automagically). From there, I can use the net.sf.hibernate.cache.Cache interface to do cache manipulation.

Thanks,
florin


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.