public boolean waitForCompletingTransaction(TXId txId) {
    TXStateProxy val;
    val = hostedTXStates.get(txId);
    if (val == null) {
      synchronized (hostedTXStates) {
        val = hostedTXStates.get(txId);
      }
    }
    if (val != null && val.isRealDealLocal()) {
      TXStateProxyImpl impl = (TXStateProxyImpl) val;
      TXState state = impl.getLocalRealDeal();
      // the thread we were waiting for would have put a TXCommitMessage
      // in the failover map, doing so here may replace an existing token
      // like TXCommitMessage.REBALANCE_MSG with null. fixes bug 42661
      // saveTXStateForClientFailover(impl);
      return state.waitForPreviousCompletion();
    }
    return false;
  }
If the given transaction is already being completed by another thread this will wait for that
completion to finish and will ensure that the result is saved in the client failover map.

@return true if a wait was performed
geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java