سؤال

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