TXStateProxy getOrSetHostedTXState(TXId key, TransactionMessage msg) {
    TXStateProxy val = hostedTXStates.get(key);
    if (val == null) {
      synchronized (hostedTXStates) {
        val = hostedTXStates.get(key);
        if (val == null && msg.canStartRemoteTransaction()) {
          if (msg.isTransactionDistributed()) {
            val = new DistTXStateProxyImplOnDatanode(cache, this, key, msg.getTXOriginatorClient(),
                statisticsClock);
            val.setLocalTXState(new DistTXState(val, true, statisticsClock));
          } else {
            val = new TXStateProxyImpl(cache, this, key, msg.getTXOriginatorClient(),
                statisticsClock);
            val.setLocalTXState(new TXState(val, true, statisticsClock));
            val.setTarget(cache.getDistributedSystem().getDistributedMember());
          }
          hostedTXStates.put(key, val);
        }
      }
    }
    return val;
  }
Associate the remote txState with the thread processing this message. Also, we acquire a lock
on the txState, on which this thread operates. Some messages like SizeMessage should not create
a new txState.

@return {@link TXStateProxy} the txProxy for the transactional message
geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java