I'm trying use Echcache in spring mvc. so for this uses java configuration similar to this:
public net.sf.ehcache.CacheManager ehCacheManager() {
net.sf.ehcache.config.Configuration config = new net.sf.ehcache.config.Configuration();
CacheConfiguration cacheConfig = new CacheConfiguration();
cacheConfig.setName("test");
cacheConfig.setMaxEntriesLocalHeap(0);
cacheConfig.setMaxEntriesLocalDisk(10);
cacheConfig.setTimeToLiveSeconds(500);
config.addCache(cacheConfig);
DiskStoreConfiguration diskStoreConfiguration = new DiskStoreConfiguration();
diskStoreConfiguration.setPath("C:/MyCache1");
config.addDiskStore(diskStoreConfiguration);
return net.sf.ehcache.CacheManager.newInstance(config);
}
and used @cachable annotation for caching. it works correctly. but all cached data saved in memory. and it create just test.data file with zero size. Now my queston is how write cached data in disk?