Class TransactionManagerAbstract

Represents an abstract class for managing transactions in a Domain-Driven Design (DDD) framework. This class sets a transactional boundary by passing an async callback with a transaction at the top of the context.

Hierarchy

  • TransactionManager

    Constructors

    Methods

    • Creates a savepoint within the specified transaction and executes the provided callback within the savepoint context.

      Parameters

      • transaction: Transaction

        The transaction in which the savepoint will be created.

      • callback: ((nestedTransaction: Transaction) => Promise<void>)

        The async callback function that will be executed within the savepoint context.

          • (nestedTransaction): Promise<void>
          • Parameters

            Returns Promise<void>

      Returns Promise<void>

      A Promise that resolves when the savepoint and the callback have completed successfully.

    • Starts a new transaction and executes the provided callback within the transaction context.

      Parameters

      • callback: ((transaction: Transaction) => Promise<void>)

        The async callback function that will be executed within the transaction context.

          • (transaction): Promise<void>
          • Parameters

            Returns Promise<void>

      Returns Promise<void>

      A Promise that resolves when the transaction and the callback have completed successfully.