[infinispan-issues] [JBoss JIRA] Commented: (ISPN-528) replace(K key, V value, long lifespan, TimeUnit unit) does not extend lifespan
Michal Szymanski (JIRA)
jira-events at lists.jboss.org
Tue Jul 6 14:17:46 EDT 2010
[ https://jira.jboss.org/browse/ISPN-528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12538043#action_12538043 ]
Michal Szymanski commented on ISPN-528:
---------------------------------------
to be honest problem is rather related to fact that I put the same object that get from cache. Probably Infinispane remove old object and new one (because it is he same copy). In my opinion cache should only remove 'old' reference in cache.
> replace(K key, V value, long lifespan, TimeUnit unit) does not extend lifespan
> ------------------------------------------------------------------------------
>
> Key: ISPN-528
> URL: https://jira.jboss.org/browse/ISPN-528
> Project: Infinispan
> Issue Type: Bug
> Components: Eviction
> Affects Versions: 4.1.0.BETA2
> Environment: Windows, Tomcat, Axis
> Reporter: Michal Szymanski
> Assignee: Manik Surtani
> Fix For: 4.1.0.CR2
>
>
> In our system we make something like this:
> tokenCache.put(tokenStr, token, 60 , TimeUnit.SECONDS);
> after let say 59seconds we call
> Token token = tokenCache.get(tokenStr); // where tokenCache is infinispan cache
> ...
> token.setValidTill(tokenTime); // some modfication of values of token
> tokenCache.replace(tokenStr, token, 60 , TimeUnit.SECONDS);
> As I understand from JAvaDoc:
> V replace(K key, V value, long lifespan, TimeUnit unit)
> replace object in cache = put token once again and in our exapmple object should live 60s more from time we call replace. But from my test when
> I call replace after 59s after initial 'put' object are removed in 60 second. When I call
> tokenCache.replace(tokenStr, token, 120 , TimeUnit.SECONDS);
> object lives 120s from initial put. Is it proper behaviour? If yes how to extend life of object by 60s = how to add 60s to lifespan?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list