Java Ehcache正在为磁盘持久性创建不必要的时间戳目录

Java Ehcache正在为磁盘持久性创建不必要的时间戳目录,java,caching,persistence,ehcache,Java,Caching,Persistence,Ehcache,我希望使用Ehcache的磁盘持久性,能够在重启之间保存数据。我的配置如下所示: <ehcache> <diskStore path="/tmp/blah"/> <defaultCache eternal="true" maxElementsInMemory="500" overflowToDisk="false" memoryStoreEvictionPolicy="LRU" statisti

我希望使用Ehcache的磁盘持久性,能够在重启之间保存数据。我的配置如下所示:

<ehcache>

  <diskStore path="/tmp/blah"/>

  <defaultCache
      eternal="true"
      maxElementsInMemory="500"
      overflowToDisk="false"
      memoryStoreEvictionPolicy="LRU"
      statistics="true"/>

  <cache
          name="myCache"
      eternal="true"
      maxElementsInMemory="10"
      maxElementsOnDisk="10000"
      overflowToDisk="true"
      diskPersistent="true"
      memoryStoreEvictionPolicy="LRU"
      statistics="true"/>

</ehcache>

提前感谢。

问题来自于我在hibernate绑定中使用了
EhCacheRegionFactory
(特定的缓存与hibernate完全无关,而是在同一个文件中定义的)

我已切换到
SingleToneCacheRegionFactory
,问题消失了

main@1, prio=5, in group 'main', status: 'RUNNING'
  at net.sf.ehcache.CacheManager.detectAndFixDiskStorePathConflict(CacheManager.java:612)
  at net.sf.ehcache.CacheManager.configure(CacheManager.java:586)
  at net.sf.ehcache.CacheManager.init(CacheManager.java:359)
  at net.sf.ehcache.CacheManager.<init>(CacheManager.java:228)
  at net.sf.ehcache.hibernate.EhCacheRegionFactory.start(EhCacheRegionFactory.java:79)
  at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:250)
  at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
  ...