Example usage for org.hibernate Cache evictEntityRegions

List of usage examples for org.hibernate Cache evictEntityRegions

Introduction

In this page you can find the example usage for org.hibernate Cache evictEntityRegions.

Prototype

@Deprecated
default void evictEntityRegions() 

Source Link

Document

Evict data from all entity regions.

Usage

From source file:org.ow2.bonita.util.DbTool.java

License:Open Source License

public static void cleanCache(final String domain, final String sessionFactoryName) throws Exception {
    // clean 2nd level cache:
    final SessionFactoryImplementor sessionFactory = getSessionFactory(domain, sessionFactoryName);
    if (sessionFactory != null) {
        Cache cache = sessionFactory.getCache();
        if (cache != null) {
            cache.evictDefaultQueryRegion();
            cache.evictQueryRegions();//from www  .  j  a v a 2 s  .  c o m
            cache.evictCollectionRegions();
            cache.evictEntityRegions();
        }
    }
}