[infinispan-dev] Replace command not checking previous value

Manik Surtani manik at jboss.org
Mon Oct 22 08:48:33 EDT 2012


On 22 Oct 2012, at 02:36, Sanne Grinovero <sanne at infinispan.org> wrote:

> Hello,
> I'm in need to use the Cache method
> 
>   .replace( key, expectedValue, newValue );
> 
> and while debugging I got into
>   org.infinispan.commands.write.ReplaceCommand.perform(InvocationContext)
> 
> which is doing "the right think" only if ctx.isOriginLocal() . What
> puzzles me most is that there even is a comment pointing this out, as
> it was a design choice made for some purpose.. some purpose which
> strongly conflicts with my needs and the API contract :-/
> 
> Could anyone please explain?

Could be due to the cost of retrieving the old value, of remote, for comparison.  The update would need to be sent to the owner of the entry anyway, and the check could be done there (where it would be local).

> 
> thanks,
> Sanne
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Manik Surtani
manik at jboss.org
twitter.com/maniksurtani

Platform Architect, JBoss Data Grid
http://red.ht/data-grid




More information about the infinispan-dev mailing list