문제

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