Joined: Tue Feb 07, 2006 2:02 am Posts: 12
|
Hi,
I configured everything to use query cache...
here is my code...
Query query1 = session.createQuery("from salegroup where id=123")
.setCacheable(true)
.setCacheMode(CacheMode.NORMAL)
.setCacheRegion("salegrp");
and to test ....
Statistics stats = sessionFactory.getStatistics();
double queryCacheHitCount = stats.getQueryCacheHitCount();
double queryCacheMissCount = stats.getQueryCacheMissCount();
double queryCachePutCount = stats.getQueryCachePutCount();
and the cofig file entry ...
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.cache.use_second_level_cache">true</property>
<property name="hibernate.generate_statistics">true</property>
the problem is the cache hit....miss...put count is always zero...
it means that query is not cached right...
can anyone please tell me what is the problem.....
_________________ Regards
.....Hiisi.....
|
|