Hibernate version: 3.3.1
Hi,
I am using Hibernate 3.3.1 and JBoss Cache 2.1.1 as second level cache. My application is Cluster-Wide structured and I have configured multi regions. I want to clean second level cache manually. I dont know am I doing it right way, but it is working. Is this code true for cleaning cache?
Code:
Map<String, Region> allSecondLevelCacheRegions = ((SessionFactoryImpl)sessionFactory).getAllSecondLevelCacheRegions();
Collection<Region> cacheRegions = allSecondLevelCacheRegions.values();
for (Region region : cacheRegions) {
region.destroy();
}
If it is not true, can you give me any idea?