-
1. Re: Expiration does not work - what is he problem?
manik Jul 6, 2010 9:13 AM (in response to michal_szymanski)The entry would be marked as expired, but not necessarily removed. Removal of expired entries happens in one of 2 ways:
1. You try and do a get() or containsKey() for that entry. The entry is then detected as expired and is removed.
2. You have enabled eviction and an eviction thread wakes up periodically and purges expired entries.
If you have not enabled (2), or your eviction thread wakeup interval is large and you probe jconsole before the eviction thread kicks in, you will still see the expired entry. You can be assured that if you tried to retrieve the entry via a get() or containsKey() though, you won't see the entry (and the entry will be removed).
-
2. Re: Expiration does not work - what is he problem?
mircea.markus Jul 6, 2010 9:51 AM (in response to manik)You can also force eviction through:
cache.getAdvancedCache().getEvictionManager().processEviction().
There's also an Cache.evict(k) method, that does eviction on a single key.
-
3. Re: Expiration does not work - what is he problem?
michal_szymanski Jul 6, 2010 11:11 AM (in response to manik)I've added
config.setEvictionStrategy(EvictionStrategy.FIFO);
config.setEvictionMaxEntries(10000);config.setEvictionWakeUpInterval(5000);
and now it works