Class UnitOfWorkAbstract

Represents a unit of work, which encapsulates a set of operations that should be treated as a single transaction. This pattern is used to manage the persistence of domain objects.

Implemented by

    Constructors

    Methods

    Constructors

    Methods

    • Commits the changes made within the unit of work. This method should persist the changes to the underlying data store.

      Returns Promise<void>

      A promise that resolves when the changes have been successfully committed.

    • Rolls back the changes made within the unit of work. This method should undo any changes made since the unit of work was started.

      Returns Promise<void>

      A promise that resolves when the changes have been successfully rolled back.

    • Starts the unit of work, initializing any necessary resources or connections. This method should be called before performing any operations within the unit of work.

      Returns Promise<void>

      A promise that resolves when the unit of work has started successfully.