Project

General

Profile

bug #2939

Updated by Andreas Kohlbecker about 7 years ago

when running tests on the integration server where already a cdmserver instance is running write permission problems are reported regarding the ehcache diskStore, is this a conflict of multiple vm instances using the same disk store location? 

 ~~~ 
 2016-12-19 15:38:09,969 WARN [net.sf.ehcache.DiskStorePathManager] - diskStorePath '/home/andreas/.cdm-server-ehcache' is already used by an existing CacheManager either in the same VM or in a different process. 
 The diskStore path for this CacheManager will be set to /home/andreas/.cdm-server-ehcache/ehcache_auto_created8966675037271472395diskstore. 
 To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache.xml) for each CacheManager instance. 
 ~~~ 

 
 solution: use timestamp prefix for diskStore? 


 in /cdmlib-remote/src/main/resources/eu/etaxonomy/cdm/remote/ehcache.xml 


 ~~~ 
 <diskStore path="java.io.tmpdir/cdm-server-ehcache" /> 
 ~~~ 

 should become something    like 


 ~~~ 
 <diskStore path="java.io.tmpdir/cdm-server-ehcache/20120010298321730/" /> 
 ~~~ 
  could this be achieved by using the `ehcache.disk.store.dir` property? setting it during app-context startup to a unique subfolder of    /tmp/ 

 **NOTE:** there is a class `eu.etaxonomy.cdm.api.cache.CdmCacher` providing a static method `getDefaultCacheManager()` 

 


 further reading:  

 * http://ehcache.org/documentation/2.4/faq#why-cant-i-run-multiple-applications-using-ehcache-on-one-machine 

 * http://ehcache.org/ehcache.xml 

 * http://ehcache.org/documentation/user-guide/storage-options#DiskStore 

 * http://stackoverflow.com/questions/9985676/spring-wired-ehcache-disk-store-create-collision-in-multi-threaded-app 



 ---- 


 there is a new related ticket on the ehcache file store location: #3580 possibly a duplicate 

Back