@Override
  public void txApplyPut(Operation putOp, Object key, Object newValue, boolean didDestroy,
      TransactionId transactionId, TXRmtEvent event, EventID eventId, Object aCallbackArgument,
      List<EntryEventImpl> pendingCallbacks, FilterRoutingInfo filterRoutingInfo,
      ClientProxyMembershipID bridgeContext, TXEntryState txEntryState, VersionTag versionTag,
      long tailKey) {

    Object wrappedNewValue;
    if (TX_PREFERS_NO_SERIALIZED_ENTRIES) {
      wrappedNewValue = newValue;
    } else {
      if (newValue instanceof CachedDeserializable || newValue instanceof byte[]
          || Token.isInvalidOrRemoved(newValue)) {
        wrappedNewValue = newValue;
      } else if (newValue instanceof Delta) {
        int vSize = CachedDeserializableFactory.calcMemSize(newValue,
            getPartitionedRegion().getObjectSizer(), false);
        wrappedNewValue = CachedDeserializableFactory.create(newValue, vSize, cache);
      } else {
        byte[] serializedBytes = null;
        if (txEntryState != null) {
          serializedBytes = txEntryState.getSerializedPendingValue();
        }

        if (serializedBytes == null) {
          serializedBytes = EntryEventImpl.serialize(newValue);
        }

        wrappedNewValue = CachedDeserializableFactory.create(serializedBytes, cache);
      }
    }

    superTxApplyPut(putOp, key, wrappedNewValue, didDestroy, transactionId, event, eventId,
        aCallbackArgument, pendingCallbacks, filterRoutingInfo, bridgeContext, txEntryState,
        versionTag, tailKey);
  }
Invoked when a primary bucket is demoted.
geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java