質問

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