Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.1.0
-
None
-
None
Description
If you want to change path to persisent cache with "diskStorePath", it has no effect because cacheManager erase this value.
In "addCacheNoCheck" method, "setDiskStorePath" call with "diskStorePath" CacheManager property value.
CacheManager.java
public void addCache(Ehcache cache) throws IllegalStateException, ObjectExistsException, CacheException { checkStatus(); if (cache == null) { return; } addCacheNoCheck(cache); } private void addCacheNoCheck(Ehcache cache) throws IllegalStateException, ObjectExistsException, CacheException { if (ehcaches.get(cache.getName()) != null) { throw new ObjectExistsException("Cache " + cache.getName() + " already exists"); } cache.setCacheManager(this); cache.setDiskStorePath(diskStorePath); cache.initialise(); try { cache.bootstrap(); } catch (CacheException e) { LOG.log(Level.WARNING, "Cache " + cache.getName() + "requested bootstrap but a CacheException occured. " + e.getMessage(), e); } ehcaches.put(cache.getName(), cache); if (cache instanceof Cache) { caches.put(cache.getName(), cache); } //Don't notify initial config. The init method of each listener should take care of this. if (status.equals(Status.STATUS_ALIVE)) { cacheManagerEventListenerRegistry.notifyCacheAdded(cache.getName()); } }