code: private <T> T withCurrentTransaction(@NotNull SqlQuery query, @NotNull TransactionCallback<T> callback) {
          SqlQuery oldQuery = DebugContext.getCurrentQuery();
          try {
              DebugContext.setCurrentQuery(query);
              if (allowImplicitTransactions) {
                  return withTransaction(callback);
              } else {
                  return transactionManager.withCurrentTransaction(callback, dialect);
              }
          } finally {
              DebugContext.setCurrentQuery(oldQuery);
          }
      }
docs: Executes the block of code within context of current transaction. If there's no transaction in progress
  throws {@link NoActiveTransactionException} unless implicit transaction are allowed: in this case, starts a new
  transaction.
  
  @throws NoActiveTransactionException if there's no active transaction.
  @see #setAllowImplicitTransactions(boolean)