[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Element Expire Not Working  XML
Forum Index -> Terracotta for Spring
Author Message
carlsum5

neo

Joined: 04/05/2012 04:07:12
Messages: 2
Offline

Hi,
I have an issue with my ehCache where i set the time to live for my element and it does not trigger the listener when the time to live has passed.
However if i set it to 5 minutes and i access the cache item on 6 minutes it will give me the expired notification on the listener and then proceed with accessing the item.

Code:
<?xml version="1.0" encoding="UTF-8"?>
 <ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd" updateCheck="false">
     <!--
      | Please see http://ehcache.sourceforge.net/documentation/configuration.html for
      | detailed information on how to configurigure caches in this file
      +-->
      
     <!-- Location of persistent caches on disk -->
     <diskStore path="java.io.tmpdir/ss7Agent" />
     
     <terracottaConfig url="192.168.8.195:9510"/>
 
     <defaultCache 	eternal="false" 
     				maxElementsInMemory="1000"
         			timeToIdleSeconds="0"
         			timeToLiveSeconds="600" 
         			memoryStoreEvictionPolicy="LRU"/>
 
     <cache  name="ActiveIslSubCache"  
     		eternal="true" 
     		maxElementsInMemory="300"
     		timeToLiveSeconds="100" 
         	memoryStoreEvictionPolicy="LRU">
                     <terracotta />  
        <cacheEventListenerFactory class="com.mt.isl.core.cache.listener.ehCacheEventListenerFactory"/>
     	  	
   	</cache>
         	
 </ehcache>


this is my config and I have the terracota server running on another machine and developing on my own laptop.

I tested with the listener on whether it gets the event when i put an element into the cache and this works fine.
Expired event doesnt seem to be working.

Regards
Nick
gyan10

ophanim

Joined: 06/28/2011 23:15:25
Messages: 701
Offline

In your config, you set eternal="true".If eternal is set then timeouts are ignored and the element is never expired.
In your case time to live will be ignored as you set eternal is true.This is could be the reason of your problem.

Cheers!!!

Gyan Awasthi
Terracotta -A Software AG company
carlsum5

neo

Joined: 04/05/2012 04:07:12
Messages: 2
Offline

nah this is still not the issue as i changed that as well....seems evictExpiredElements() method does not work as well...
 
Forum Index -> Terracotta for Spring
Go to:   
Powered by JForum 2.1.7 © JForum Team