Stores given key-value pair in cache only if there is a previous mapping for it.
In case of
CacheMode#PARTITIONED or
CacheMode#REPLICATED caches,
the value will be loaded from the primary node, which in its turn may load the value
from the swap storage, and consecutively, if it's not in swap,
from the underlying persistent storage. If value has to be loaded from persistent
storage,
CacheStore#load(Transaction, Object)
method will be used.
If the returned value is not needed, method
#replace(Object,Object) should
always be used instead of this one to avoid the overhead associated with returning of the
previous value.
If write-through is enabled, the stored value will be persisted to
CacheStorevia CacheStore#put(Transaction, Object, Object)
method.
Transactions
This method is transactional and will enlist the entry into ongoing transaction
if there is one.