• Bug
  • Status: Closed
  • 2 Major
  • Resolution: Duplicate
  • ehcache-core
  • cdennis
  • Reporter:
  • October 20, 2009
  • 0
  • Watchers: 0
  • November 19, 2009
  • October 26, 2009

Description

User has all caches reporting the same stats in Hibernate unless he configures caches.

What would explain this is a clone problem in cache, where the same stats are used.

=================

I believe I found what was causing this issue. It seems to happen if I do not explicitly define a element for each entity. Once I define a element for each entity, the statistics work fine.

From: [email protected] To: [email protected] CC: [email protected] Subject: RE: [Ehcache-List] cache statistics Date: Mon, 19 Oct 2009 14:34:23 -0500

I am getting the cacheManager instance by calling CacheManager.getInstance().

The stats start out at 0 when I start the jvm. As I run test queries, they all being to increase, for example, from 0 –> 3 –> 29 –> 45, etc.

Very strange because if I attache the Ehcache1.6.2 sources and debug Cache or Statistics I can see that those caches actually do all have the same values for hits and misses. So it appears that when one cache’s stats are upated then the others get update also.

CC: [email protected] From: [email protected] To: [email protected] Subject: Re: [Ehcache-List] cache statistics Date: Mon, 19 Oct 2009 14:27:42 -0500

Yeah, I guess so - I’m just not in the habit of thinking about it that way.

How are you getting the cacheManager instance? When you see stats are they steady at 0 or at some non-0 value?

On Oct 19, 2009, at 2:17 PM, Andy wrote:

I was once told “It is simply a template to be used when you simply want to create a cache. It never gets data put in it. Data is always put into a cache that has been cloned from the default cache.” Did this used to be the case and has since changed?

I am obtaining the cache instance by calling cacheManager.getCacheNames(), iterating over the list of cache names and calling cacheManager.getCache() for each.

CC: [email protected] From: [email protected] To: [email protected] Subject: Re: [Ehcache-List] cache statistics Date: Mon, 19 Oct 2009 14:10:11 -0500

Not sure what you mean by “auto created from the default cache”? The is an actual cache with a special name, not a set of defaults to apply to caches with unspecified configuration. How are you obtaining the cache instance?

On Oct 19, 2009, at 1:36 PM, Andy wrote:

Hi, I am writing a page to display a list of caches as well as information about each cache. I wanted to display the hit/miss count for each cache by using cache.getStatistics().getCachHits() and cache.getStatistics().getCachMisses(). However I am noticing that the hit and miss counts are staying the same for all of the hibernate entiy caches. Am I maybe missing something or could it be due to my configuration where I don’t explicitly define any of the entity caches and instead have them auto-created from the default cache? My configuration is Hibernate 2nd level/query cache+Spring+Ehcache1.6.2. Thanks

<?xml version=”1.0” encoding=”UTF-8”?>

Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. Sign up now. _______________________________________________ Ehcache-List mailing list [email protected] http://lists.terracotta.org/mailman/listinfo/ehcache-list

Hotmail: Trusted email with Microsoft’s powerful SPAM protection. Sign up now.

Hotmail: Trusted email with powerful SPAM protection. Sign up now. Hotmail: Trusted email with powerful SPAM protection. Sign up now. _______________________________________________ Ehcache-List mailing list [email protected] http://lists.terracotta.org/mailman/listinfo/ehcache-list

Comments

Alex Miller 2009-10-26

Dup of EHC-442