Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 288
javagirl Avatar asked Mar 26 '13 17:03

javagirl


People also ask

Is Ehcache persistent?

Open-source Ehcache offers a limited version of persistence, as noted in this document. Fast Restart provides enterprise-ready crash resilience with an option to store a fully consistent copy of the cache on the local disk at all times.

What happens when Ehcache is full?

In Ehcache, the MemoryStore may be limited in size (see How to Size Caches for more information). When the store gets full, elements are evicted.

How does Ehcache work?

Ehcache can assist you with reducing the likelihood that stale data is used by your application by expiring cache entries after some amount of configured time. Once expired, the entry is automatically removed from the cache.


1 Answers

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.

like image 58
mindas Avatar answered Oct 06 '22 19:10

mindas