5 Replies Latest reply on Jun 16, 2017 1:14 AM by Tristan Tarrant

    how does remoteCache.putIfAbsent work?

    Shankar Sea Novice

      Just wanted to get a better idea of what this method does as my expectation doesn't align with what is happening:

       

      I am using a remote cache with compatibility mode on.  My key is a string.

       

      1) remoteCache.putIfAbsent(key1, value1)

      2) return null which is expected as it's the first time

       

      1) remoteCache.putIfAbsent(key1, value2)

      2) return null which I don't understand, should it return value1? or is it because it's a new value2 that it returns null?  There is still only one entry in the cache.