public void close() {
    if (isClosed()) {
      return;
    }
    TXStateProxy[] proxies = null;
    synchronized (hostedTXStates) {
      // After this, newly added TXStateProxy would not operate on the TXState.
      closed = true;

      proxies = hostedTXStates.values().toArray(new TXStateProxy[0]);
    }

    for (TXStateProxy proxy : proxies) {
      proxy.getLock().lock();
      try {
        proxy.close();
      } finally {
        proxy.getLock().unlock();
      }
    }
    for (TXStateProxy proxy : localTxMap.values()) {
      proxy.close();
    }
    TransactionListener[] listeners = getListeners();
    for (final TransactionListener listener : listeners) {
      closeListener(listener);
    }

    currentInstance.compareAndSet(this, null);
  }
sets {@link TXStateProxy#setInProgress(boolean)} when a txContext is present. This method must
only be used in fail-over scenarios.

@param progress value of the progress flag to be set
@return the previous value of inProgress flag
@see TXStateProxy#setInProgress(boolean)
geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java