在我的ehcache配置中,我看到以下内容:
eternal="false"
timeToIdleSeconds="0"
timeToLiveSeconds="0"这是什么意思?
文档中提到,timeToLiveSeconds="0“表示不会进行这些检查。因此,这意味着对象将是永恒的,即使“永恒”设置为false也是如此?
发布于 2013-03-27 01:57:47
如果您查看CacheConfiguration.java:826 (我的Ehcache2.6.5版本),您将看到以下内容:
if (eternal) {
setTimeToIdleSeconds(0);
setTimeToLiveSeconds(0);
}所以它本质上是一样的。
发布于 2013-05-14 00:07:16
设置为true时,属性“”eternal“”将重写TimeToIdle和TimeToLive参数。“当设置为false时,不会对配置产生影响。因此,在上面的例子中,将考虑setTimeToIdleSeconds(0)和setTimeToLiveSeconds(0)参数,并且缓存元素将在生命周期内保留(因为0表示无限)。
https://stackoverflow.com/questions/15644000
复制相似问题