-->
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.  [ 4 posts ] 
Author Message
 Post subject: Looking into the EHCache
PostPosted: Thu May 26, 2005 2:53 pm 
Newbie

Joined: Fri Oct 22, 2004 10:55 am
Posts: 17
Hibernate version:2.1.8

EHCache version: 1.1

We are using ehcache with hibernate for 2nd level cache. It is working fine.

How can I look inside the cache to see what exactly is in there. Is there any way to get the instance of net.sf.ehcache.CacheManager as once I have that I can look into the cache.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 3:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Use statistics API of HB3


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 26, 2005 4:06 pm 
Newbie

Joined: Fri Oct 22, 2004 10:55 am
Posts: 17
But we are using 2.1.8. We can not upgrade right now. What is the best way to do it in 2.1.8.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 01, 2005 5:42 pm 
Newbie

Joined: Fri Oct 22, 2004 10:55 am
Posts: 17
Finally figured it out.

I can get the handle to EhCache's CacheManager used by the hibernate using the following:

CacheManager cacheManager = CacheManager.getInstance()

and once I have that I can get all the Caches out of it using:

String[] cacheNames = cacheManager.getCacheNames();
List cacheList = new ArrayList();
for (int i = 0; i < cacheNames.length; i++)
{
cacheList.add(cacheManager.getCache(cacheNames[i]));
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.