-->
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.  [ 3 posts ] 
Author Message
 Post subject: EhCache Memory Consumption / Statistics
PostPosted: Tue Nov 07, 2006 6:41 pm 
Newbie

Joined: Wed Oct 25, 2006 3:26 pm
Posts: 7
I'm using ehcache as my second level cache for hibernate.
I would like to obtain statistics as to the size of each cache I have configured in my ehcache.xml.

I thought I could obtain access to such information via the CacheManager, but when I try to get an instance of CacheManager by:

CacheManager.getInstance()

This generates the following stack trace:
Exception in thread "CacheMonitor"
net.sf.ehcache.CacheException: Cannot parseConfiguration CacheManager. Attempt to create a new instance of CacheManager using the diskStorePath "null" which is already used by an existing CacheManager.
The source of the configuration was classpath.
at net.sf.ehcache.CacheManager.configure(CacheManager.java:248)


I didn't think it would/should try to create a new instance of CacheManager, as one must have been instantiated at startup.

As a side note/question - has anyone been able to get ehcache-1.2.3 working with hibernate 3.2 ?

-Mike


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 07, 2006 6:50 pm 
Beginner
Beginner

Joined: Fri May 06, 2005 2:37 pm
Posts: 39
Ehcache 1.2.3 works well with Hibernate 3.2 over here.

By default, hibernate uses an instance cache (not a static cache) with Ehcache (that's changed recently). You can either use the Singleton provider from Ehcache, or you can use the Hibernate cache statistics (which are somewhat shallow, but are from JMX), or you can dig out the backing cache from the SessionFactory.

Ehcache is also working on a JMX bean to monitor statistics.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 07, 2006 10:17 pm 
Newbie

Joined: Wed Oct 25, 2006 3:26 pm
Posts: 7
Thanks !


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