I try to enable the Hibernate query cache in my application which runs inside Wildfly 8.2. I read through all documentations without any result.
Can anybody please give me a minimalistic example what I have to do. Please including all configurations like persistence.xml, hibernate.cfg.xml, ...
After configuring the cache I run the following code after the query was executed to check if the cache works.
log.trace("getEntityLoadCount: " + statistic.getEntityLoadCount());
log.trace("getTransactionCount: " + statistic.getTransactionCount());
log.trace("getQueryCacheHitCount: " + statistic.getQueryCacheHitCount());
log.trace("getQueryCacheMissCount: "
+ statistic.getQueryCacheMissCount());
log.trace("getQueryCachePutCount: " + statistic.getQueryCachePutCount());
log.trace("getSecondLevelCacheHitCount: "
+ statistic.getSecondLevelCacheHitCount());
log.trace("getSecondLevelCacheMissCount: "
+ statistic.getSecondLevelCacheMissCount());
log.trace("getSecondLevelCachePutCount: "
+ statistic.getSecondLevelCachePutCount());
log.trace("getSecondLevelCacheRegionNames: "
+ Arrays.toString(statistic.getSecondLevelCacheRegionNames()));