In my ehcache configuration I see these:

eternal="false"
timeToIdleSeconds="0"
timeToLiveSeconds="0"

What does that mean effectively?

Documentation mentions that timeToLiveSeconds="0" means these checks will not be made. So this means objects will be eternal, even if "eternal" is set to false?

有帮助吗?

解决方案

If you look at CacheConfiguration.java:826 (my version of Ehcache is 2.6.5), you will see the following:

if (eternal) {
    setTimeToIdleSeconds(0);
    setTimeToLiveSeconds(0);
}

So it's essentially the same thing.

其他提示

The property 'eternal' when set to true overrides the TimeToIdle and TimeToLive parameters. When set to false it has not effect to the configuration. Thus in the above case setTimeToIdleSeconds(0) and setTimeToLiveSeconds(0) parameters will be considered and cache elements will stay for lifetime(as 0 indicates infinite).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top