【发布时间】:2015-07-21 10:42:43
【问题描述】:
我的 ehcache 配置是这样开始的:
<ehcache maxBytesLocalHeap="200M" updateCheck="false">
在遇到“maxEntriesLocalHeap 与缓存管理器上设置的 maxBytesLocalHeap 不兼容”之类的错误后,我查看了 spring-context-support 的来源:
@SuppressWarnings("deprecation")
public EhCacheFactoryBean() {
setMaxEntriesLocalHeap(10000);
setMaxElementsOnDisk(10000000);
setTimeToLiveSeconds(120);
setTimeToIdleSeconds(120);
}
对 setMaxElementsOnDisk 的调用是这样注释的:
void net.sf.ehcache.config.CacheConfiguration.setMaxElementsOnDisk(int maxElementsOnDisk)
Deprecated. use setMaxEntriesLocalDisk(long) for unclustered caches and setMaxEntriesInCache(long) for clustered caches.
Sets the maximum number elements on Disk. 0 means unlimited.
This property can be modified dynamically while the cache is operating.
Parameters:
maxElementsOnDisk the maximum number of Elements to allow on the disk. 0 means unlimited.
这是否意味着使用 spring 4.1.7 及其依赖项 ehcache 2.9.1 集群缓存是不可能使用 springs EhCacheFactoryBean 的?
最好的问候, 卡斯滕
【问题讨论】: