|
@@ -96,15 +96,16 @@ public class EhCacheBasedUserCache implements UserCache, InitializingBean,
|
|
|
|
|
|
public void afterPropertiesSet() throws Exception {
|
|
|
if (CacheManager.getInstance().cacheExists(CACHE_NAME)) {
|
|
|
- CacheManager.getInstance().removeCache(CACHE_NAME);
|
|
|
- }
|
|
|
+ // don’t remove the cache
|
|
|
+ } else {
|
|
|
+ manager = CacheManager.create();
|
|
|
|
|
|
- manager = CacheManager.create();
|
|
|
+ // Cache name, max memory, overflowToDisk, eternal, timeToLive, timeToIdle
|
|
|
+ cache = new Cache(CACHE_NAME, Integer.MAX_VALUE, false, false,
|
|
|
+ minutesToIdle * 60, minutesToIdle * 60);
|
|
|
|
|
|
- // Cache name, max memory, overflowToDisk, eternal, timeToLive, timeToIdle
|
|
|
- cache = new Cache(CACHE_NAME, Integer.MAX_VALUE, false, false,
|
|
|
- minutesToIdle * 60, minutesToIdle * 60);
|
|
|
- manager.addCache(cache);
|
|
|
+ manager.addCache(cache);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public void destroy() throws Exception {
|