[infinispan-dev] NPE with Cache.replace()

Sanne Grinovero sanne at infinispan.org
Tue May 21 06:21:00 EDT 2013


On 21 May 2013 11:14, Bela Ban <bban at redhat.com> wrote:
> [Mircea]
>
> Might be a problem in xsite replication when the keys that are updated
> are not present. This happens all the time as xsite state transfer is
> not yet implemented: a new site comes online, no state transfer, and an
> xsite replication update will not be able to replace non-existing keys.
>
> I suggest to use a straight put() for updates, or a new internal
> replaceIfPresentOrPutIfNotPresent()...

That might not work if the hascode resolves to an uneven number, in
that case you obviously will wish to remove the next key as well, so
I'd rather suggest

replaceIfPresentOrPutIfNotPresentAndHashCodeIsEvenOtherwiseRemoveNextKey();

for clarity.


More information about the infinispan-dev mailing list