Hope this can be helpful to someone (4.x sleep mode).
Excerpt from my spring configuration:
public Properties hibernateProperties() { Properties properties = new Properties(); properties.setProperty("hibernate.hbm2ddl.auto", env.getProperty("hibernate.hbm2ddl.auto")); properties.setProperty("hibernate.dialect", env.getProperty("hibernate.dialect")); properties.setProperty("hibernate.format_sql", "true"); properties.setProperty("hibernate.generate_statistics", env.getProperty("hibernate.generate_statistics")); // second-level cache: properties.setProperty("hibernate.cache.use_second_level_cache", "true"); properties.setProperty("hibernate.cache.region.factory_class", "org.hibernate.cache.EhCacheRegionFactory"); properties.setProperty("net.sf.ehcache.configurationResourceName", env.getProperty("net.sf.ehcache.configurationResourceName")); return properties; }
You should have "org.hibernate: hibernate-ehcache: HIBERNATE_VERSION" in your class path.
See: Ehcache doc in sleep configuration
source share