Closed jonekdahl closed 9 years ago
Hey Jon, Thanks for the detailed report. I'll look into this today and will update you here... Alex
There is a bug indeed. It's identified... PR coming up
Great, for a while there I was really wondering what I was doing wrong.
I'm to blame for this, sorry about that. But thanks again for this detailed description! Really helps helping you quickly :). I'm proposing we cut a 1.0.1 release early November, but you probably may want to check the -SNAPSHOT as soon as this is merged in!
@alexsnaps, what is the plan for the 1.0.1 release?
Working on getting this out asap, hopefully today!
timeToIdleSeconds and timeToLiveSeconds are not working as expected when I'm using ehcache with spring boot by configuring through xml.
My sample ehcache configuration looks like below: <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd" updateCheck="true" monitoring="autodetect" dynamicConfig="true">
<diskStore path="java.io.tmpdir" />
<cache name="usersCache"
maxEntriesLocalHeap="10000"
maxEntriesLocalDisk="1000"
eternal="false"
diskSpoolBufferSizeMB="20"
timeToIdleSeconds="3"
timeToLiveSeconds="3"
memoryStoreEvictionPolicy="LFU"
transactionalMode="off">
<persistence strategy="localTempSwap" />
</cache>
Even after 3 seconds, element is not flushed or evicted from cache. Please let me know, if my configuration is wrong or missed anything.
I'm using Ehcache 3.5.2 version.
@gchaitu795 No you are not. This is an Ehcache 2 configuration. And ehcache-jcache is for Ehcache 2. This project is not maintained anymore.
If you have user support questions, please use the ehcache mailing list. Picking randomly an issue that seems to be related to your question is not really considered good manners.
Cache element expiry does not seem to work properly when the JCache API is used with a cache that is configured through ehcache.xml.
ehcache.xml:
My understanding is that the above config file creates an in-memory cache with 123 elements, and that elements time out after 1 second. I believe the following test case verifies my assumptions, note that the second test case uses the unwrapped ehcache instance from the JCache API:
EhCache test case:
The above tests are both successful. When accessing the "same" cache through the JCache API however, the elements does not seem to expire. The test
testJCacheXmlConfigured
below consistently fails on the third assert ("Should have timed out by now").JCache test case: