ehcache - Hibernate second level cache: Hit and miss counts are always 0 -


i using hibernate 4.1.7 , ehcache second level cache

<property name="hibernate.cache.region.factory_class">           org.hibernate.cache.ehcache.ehcacheregionfactory</property>               <property name="hibernate.cache.use_second_level_cache">true</property> <property name="hibernate.cache.use_query_cache">true</property> 

when check miss count , hit count before , after db calls, 0.

long loadentitycount = hibernateutil.getsessionfactory().getstatistics().getsecondlevelcachestatistics("com.xys.program").getelementcountinmemory();     long hitcount = hibernateutil.getsessionfactory().getstatistics().getsecondlevelcachestatistics("com.xys.program").gethitcount();     long misscount = hibernateutil.getsessionfactory().getstatistics().getsecondlevelcachestatistics("com.xys.program").getmisscount(); 

list patientprograms = getprogramsforpatient( r);

loadentitycount = hibernateutil.getsessionfactory().getstatistics().getsecondlevelcachestatistics("com.xyz.program").getelementcountinmemory();         hitcount = hibernateutil.getsessionfactory().getstatistics().getsecondlevelcachestatistics("com.xyz.program").gethitcount();         misscount = hibernateutil.getsessionfactory().getstatistics().getsecondlevelcachestatistics("com.xyz.program").getmisscount(); 

i expecting non 0 values both cases , miss count goes up.

any help?


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -