We have an application that uses Hibernate\'s 2nd level caching to avoid database hits.
I was wondering if there is some easy way to invalidate the Java application
I was searching how to invalidate all Hibernate caches and I found this useful snippet:
sessionFactory.getCache().evictQueryRegions();
sessionFactory.getCache().evictDefaultQueryRegion();
sessionFactory.getCache().evictCollectionRegions();
sessionFactory.getCache().evictEntityRegions();
Hope it helps to someone else.