According to the docs, your expectation is correct in that setting time to live to 0 means that there is no time to live. And hence the JIRA to enhance this such that we are able to specify a ttl of 0 such that elements are evicted pretty much immediately.
I suspect that the reason you see your nodes being removed so quickly has to do with something else. Have you got log messages showing that elements are being evicted almost as soon as they are put into the cache?
thanks for the quick reply.
I tested the cache behavior by setting a very high ttl value and them inspecting the cache in the jboss jmx console.
I didnt find how to setup log or debug messages for the cayenne version of jboss cache. Do you or someone know how to do that?
and about this quote:
maxNodes=5 -> when the cache fqn "/company" have 2 objects and a third one is going to be put in the cache, the eviction policy is applied and one of the previous objects is removed.
is that the correct behavior?
You can get more detailed logs by :
1) Adding log4j jars to your classpath
2) Adding a log4j.xml file to your classpath, or point to it using -Dlog4j.configuration=/path/to/log4j.xml
3) Edit your log4j.xml file to print out TRACE or DEBUG level messages for org.jboss.cache.
Not sure as to why you have an issue with maxNodes, logging will tell you more.