Thank you for quick reply!
I have statistics enabled in ehCache config:
<defaultCache .... statistics=true />
In hibernate.xml I have:
<property name="hibernate.cache.use_second_level_cache" value="true" />
<property name="hibernate.cache.region.factory_class" value="net.sf.ehcache.hibernate.EhCacheRegionFactory" />
<property name="net.sf.ehcache.configurationResourceName" value="HibernateCache.xml" />
<property name="hibernate.cache.use_query_cache" value="true" />
<property name="hibernate.cache.use_structured_entries" value="true" />
<property name="hibernate.generate_statistics" value="true" />
I thought that when I define configurationResourceName in hibernate.xml file it becomes the default ehCache configuration file.
I changed my code and it worked. I am getting all may cache stats.
Code:
CacheManager manager = new CacheManager("src/config/HibernateCache.xml");