public void executeBeforeCompletion(TXState txState, Executor executor,
      CancelCriterion cancelCriterion) {
    executor.execute(() -> doOps(txState, cancelCriterion));

    beforeCompletion.execute(cancelCriterion);
  }
This class ensures that beforeCompletion and afterCompletion are executed in the same thread.

@since Geode 1.7.0
geode-core/src/main/java/org/apache/geode/internal/cache/SingleThreadJTAExecutor.java