docs: public Transaction currentTransaction() {
          Transaction localTx = LOCAL_TRANSACTION.get();
          if (localTx != null) {
              return localTx;
          }
          try {
              javax.transaction.Transaction txn = txnMgr.getTransaction();
              if (txn == null) {
                  // no active transaction
                  return null;
              }
              if (Status.STATUS_ACTIVE != txn.getStatus()) {
                  // there is a user transaction which is not valid, so abort everything
                  throw new IllegalStateException(JcrI18n.errorInvalidUserTransaction.text(txn));
              }
              return transactionTable.get(txn);
          } catch (SystemException e) {
              logger.debug(e, "Cannot determine if there is an active transaction or not");
              return null;
          }
  
      }