Search code examples
cachingehcacheterracotta

Ehcache - whether objects are eternal or not


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?


Solution

  • 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.