Member Junction
    Preparing search index...

    Interface EntityTransactionScope

    A handle to a unit of work that will either commit or roll back as a whole.

    Obtained from IMetadataProvider.BeginEntityTransaction. The scope is settle-once: the first call to EntityTransactionScope.Commit or EntityTransactionScope.Rollback settles it and every later call is a no-op. That makes the standard try { work; Commit() } catch { Rollback() } shape safe even when the work itself already rolled back on the way out.

    A scope does not necessarily correspond to a physical database transaction. When one is already in flight on the provider, the scope joins it — committing the inner scope releases a savepoint rather than committing the outer transaction. Inspect IsNested to tell the two apart; correctness never requires you to.

    interface EntityTransactionScope {
        IsNested: boolean;
        Commit(): Promise<void>;
        Rollback(): Promise<void>;
    }
    Index

    Properties

    Methods

    Properties

    IsNested: boolean

    True when this scope joined a transaction that was already in flight on the provider, rather than starting a new physical one.

    Informational only — for logging and diagnostics. Commit/rollback behave correctly either way, and callers must not branch on this to decide whether to settle the scope.

    Methods

    • Settles the scope successfully. On the outermost scope this commits the physical transaction; on a nested scope it releases the savepoint. No-op if the scope is already settled.

      Returns Promise<void>

    • Settles the scope by undoing its work. On the outermost scope this rolls the physical transaction back; on a nested scope it rolls back to the savepoint. No-op if the scope is already settled.

      Returns Promise<void>