8 Replies Latest reply on Feb 26, 2008 6:21 AM by hang liu

    LRU Eviction Policy is clearing the entire cache after MaxAg

    Anthony DePalma Newbie

      We have a cache region that holds a few thousand dynamic elements for a specified timeout, in a distributed environment. The code for the eviction policy looks like this:

      <attribute name="EvictionPolicyConfig">
       <attribute name="wakeUpIntervalSeconds">5</attribute>
       <!-- This defaults to 200000 if not specified -->
       <attribute name="eventQueueSize">200000</attribute>
       <attribute name="policyClass">
       <region name="/seamless/qb">
       <attribute name="maxNodes">0</attribute>
       <attribute name="maxAgeSeconds">300</attribute>
       <attribute name="timeToLiveSeconds">0</attribute>

      Unfortunately, we expected that individual elements would expire after the time, but instead it seems the entire region is dropped once the timeout occurs. Originally we had the timeToLiveSeconds with the same timeout and I thought that was why the region was clearing. But after setting it to 0, the same situation happens where the entire region is cleared after 300 seconds.

      How can I specify that an individual element in cache can live 300 seconds, and only those that expire are removed?