-->
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.  [ 2 posts ] 
Author Message
 Post subject: Coherence L2 cache enabled, but hitCount not increasing
PostPosted: Fri Aug 12, 2011 3:37 am 
Newbie

Joined: Fri Aug 12, 2011 3:16 am
Posts: 1
First my setup,
L2 cache: Coherence 3.7
Nodes in cluster: 2
Within coherence config files , cluster name for the same and the caching service is also the same. Actually the config files are the same.
Both nodes running on the same machine.
Within hibernate.cfg.xml
<property name="cache.use_second_level_cache">true</property>
<property name="cache.provider_class">com.tangosol.coherence.hibernate.CoherenceCacheProvider</property>
<property name="hibernate.cache.region_prefix"></property>
<!-- Disable the query cache -->
<property name="cache.use_query_cache">false</property>
<property name="hibernate.show_sql">false</property>

<!-- statistics -->
<property name="generate_statistics">true</property>

The sequence of the running the apps is as follows
Node1: Begin
Node2: Begin and perform transactions that should be cached
Node2: Stop
Node2: Begin and perform the same transactions
Node2: Stop
Node1: Show stats

The stats are as follows for most of the regions
SecondLevelCacheStatistics[hitCount=0,missCount=0,putCount=0,elementCountInMemory=22,elementCountOnDisk=-1,sizeInMemory=-1]

And the logs during the second run, clearly show the hits, misses and puts, but these are not reflected in the stats.
[2011-08-12T12:22:20.424+05:30] [hibernate] [TRACE:32] [] [org.hibernate.cache.ReadWriteCache] [tid: main] [ecid: 0000J6wkkgy1ZbOLMip2ie1EHCqK000000,0] [SRC_CLASS: org.hibernate.cache.ReadWriteCache] [SRC_METHOD: get] Cache lookup:
[2011-08-12T12:22:20.424+05:30] [hibernate] [TRACE:32] [] [org.hibernate.cache.ReadWriteCache] [tid: main] [ecid: 0000J6wkkgy1ZbOLMip2ie1EHCqK000000,0] [SRC_CLASS: org.hibernate.cache.ReadWriteCache] [SRC_METHOD: get] Cache miss:
[2011-08-12T12:22:20.427+05:30] [hibernate] [TRACE:32] [] [org.hibernate.cache.ReadWriteCache] [tid: main] [ecid: 0000J6wkkgy1ZbOLMip2ie1EHCqK000000,0] [SRC_CLASS: org.hibernate.cache.ReadWriteCache] [SRC_METHOD: put] Caching:
[2011-08-12T12:22:20.496+05:30] [hibernate] [TRACE:32] [] [org.hibernate.cache.ReadWriteCache] [tid: main] [ecid: 0000J6wkkgy1ZbOLMip2ie1EHCqK000000,0] [SRC_CLASS: org.hibernate.cache.ReadWriteCache] [SRC_METHOD: get] Cache lookup:
[2011-08-12T12:22:20.497+05:30] [hibernate] [TRACE:32] [] [org.hibernate.cache.ReadWriteCache] [tid: main] [ecid: 0000J6wkkgy1ZbOLMip2ie1EHCqK000000,0] [SRC_CLASS: org.hibernate.cache.ReadWriteCache] [SRC_METHOD: get] Cache hit:

Most of the forums ask the dev to switch on the generate_stats flag in hibernate. I've done that.
What else am I missing


Top
 Profile  
 
 Post subject: Re: Coherence L2 cache enabled, but hitCount not increasing
PostPosted: Thu Aug 18, 2011 5:54 am 
Newbie

Joined: Thu Aug 18, 2011 5:47 am
Posts: 1
You forget set "hibernate." prefix for properties. What topology your are using?

Also run cache with default hibernate configurations:
-Dtangosol.coherence.hibernate.cacheconfig=/hibernate-cache-config.xml


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