Interface TransactionHandler

  • All Known Implementing Classes:
    TransactionHandlerImpl

    public interface TransactionHandler
    Contains utility methods to run transactions. It is different from Spring's TransactionTemplate because it handles the current InvocationContext's EntityManager and CyclosException#shouldRollback()
    • Method Detail

      • run

        <T> Pair<T,​Boolean> run​(TransactionLevel transactionLevel,
                                      TransactionCallback<T> callback)
        Runs the given transaction callback in the current thread, forcing there's no current transaction. The transaction will comply with the given TransactionLevel.
        Returns:
        a Pair with the callback's result and a boolean indicating if the transaction was committed or not.