docs: public final void terminateTransaction(GlobalTransaction globalTransaction, boolean local, boolean remote) {
        TransactionStatistics txs = null;
  
        if (local) {
           txs = removeTransactionStatistic(globalTransaction, true);
        }
        if (txs != null) {
           txs.terminateTransaction();
           cacheStatisticCollector.merge(txs);
           txs = null;
        }
        if (remote) {
           txs = removeTransactionStatistic(globalTransaction, false);
        }
        if (txs != null) {
           txs.terminateTransaction();
           cacheStatisticCollector.merge(txs);
        }
     }