* auto-shutdown ehcache (so it's only shut down if it has been initialized before)

This commit is contained in:
Reinhard Pointner 2012-10-27 06:34:22 +00:00
parent c0828bb8a5
commit e277ea2af3
1 changed files with 4 additions and 1 deletions

View File

@ -338,6 +338,10 @@ public class Main {
* Shutdown ehcache properly, so that disk-persistent stores can actually be saved to disk
*/
private static void initializeCache() {
// auto-shutdown ehcache
System.setProperty("net.sf.ehcache.enableShutdownHook", "true");
Logger.getLogger("net.sf.ehcache.CacheManager").setLevel(Level.OFF);
// prepare cache folder for this application instance
File cacheRoot = new File(getApplicationFolder(), "cache");
@ -360,7 +364,6 @@ public class Main {
@Override
public void run() {
CacheManager.getInstance().shutdown();
try {
lock.release();
} catch (Exception e) {