[infinispan-issues] [JBoss JIRA] (ISPN-1816) Problem with Infinispan 5.1.0.FINAL and put with lifespan parameter

Damiano Pezzotti (JIRA) jira-events at lists.jboss.org
Tue Jan 31 05:42:48 EST 2012


Damiano Pezzotti created ISPN-1816:
--------------------------------------

             Summary: Problem with Infinispan 5.1.0.FINAL and put with lifespan parameter
                 Key: ISPN-1816
                 URL: https://issues.jboss.org/browse/ISPN-1816
             Project: Infinispan
          Issue Type: Bug
          Components: Core API
    Affects Versions: 5.1.0.FINAL
            Reporter: Damiano Pezzotti
            Assignee: Manik Surtani
            Priority: Blocker
             Fix For: 5.1.1.CR1, 5.1.1.FINAL


Hi,
I'm trying to migrate my application to Infinispan 5.1.0.FINAL but I have some problem.
 
My code uses put method passing lifespan parameter. In the new Infinispan version it seems that if I put an entry to the cache with a lifespan (e.g. 10 seconds) and then, after 5 seconds, I put the same entry with lifespan = 10 seconds, the lifespan is not overrided and the cache entry expires after 10 seconds from the first operation.
 
Here an example of code that reproduces the problem:
 
        final Cache cache = .... // Obtain cache instance
       
        // Put entry in cache
        cache.put( "key_001", "v_001", 10, TimeUnit.SECONDS );
 
        int x = 0;
        while ( true ) {
            // print cache entry every 500ms
            System.out.println( ( x++ * 500 ) + "--->" + cache.get( "key_001" ) );
 
            // every 5 seconds put the same entry with lifespan = 10 seconds
            if ( x % 10 == 0 ) {
                System.out.println("PING");
                cache.put( "key_001", "v_001", 10, TimeUnit.SECONDS );
            }
            Thread.sleep( 500 );
        }
 
The results is:
0--->v_001
500--->v_001
1000--->v_001
1500--->v_001
2000--->v_001
2500--->v_001
3000--->v_001
3500--->v_001
4000--->v_001
4500--->v_001
PING
5000--->v_001
5500--->v_001
6000--->v_001
6500--->v_001
7000--->v_001
7500--->v_001
8000--->v_001
8500--->v_001
9000--->v_001
9500--->v_001
PING
10000--->null
10500--->null
11000--->null
11500--->null
12000--->null
12500--->null
13000--->null
13500--->null
14000--->null
14500--->null
PING
15000--->v_001
15500--->v_001
16000--->v_001
16500--->v_001
17000--->v_001
17500--->v_001
 
With Infinispan 5.0.1 the result is
0--->v_001
500--->v_001
1000--->v_001
1500--->v_001
2000--->v_001
2500--->v_001
3000--->v_001
3500--->v_001
4000--->v_001
4500--->v_001
PING
5000--->v_001
5500--->v_001
6000--->v_001
6500--->v_001
7000--->v_001
7500--->v_001
8000--->v_001
8500--->v_001
9000--->v_001
9500--->v_001
PING
10000--->v_001
10500--->v_001
11000--->v_001
11500--->v_001
12000--->v_001
12500--->v_001
13000--->v_001
13500--->v_001
14000--->v_001
14500--->v_001
PING
15000--->v_001
15500--->v_001
16000--->v_001
16500--->v_001
17000--->v_001
17500--->v_001
 


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the infinispan-issues mailing list