}
putInternal(service.toData(key, partitionStrategy), service.toData(value));
txMap.put(key, new TxnValueWrapper(value, TxnValueWrapper.Type.UPDATED));
return wrapper.value;
} else {
Data oldValue = replaceInternal(service.toData(key, partitionStrategy), service.toData(value));
if (oldValue != null) {
txMap.put(key, new TxnValueWrapper(value, TxnValueWrapper.Type.UPDATED));
}
return service.toObject(oldValue);
}