Friday, June 1, 2012

EhCache Query Cache Usage

For each hibernate query:
q.setCacheable(true);
q.setCacheRegion(cacheRegionName); // use classname by convention

To evict the queries:
HibernateUtil.getSessionFactory().getCache().evictQueryRegion(cacheRegionName);

No comments:

Post a Comment