IT-1588: preserve original error when rollback fails #14

Closed
opened 2026-10-15 13:05:10 +03:00 by agrynco · 0 comments
Owner

Related Invemory bug: https://yt.hrynco.com/issue/IT-1588

The EF unit of work calls RollbackAsync after an action or CommitAsync fails. If PostgreSQL has already completed the transaction, rollback throws NpgsqlTransaction has completed and hides the original database error. Its cached transaction reference is also retained after disposal.

Scope

  • Preserve the original action or commit exception if rollback also fails.
  • Clear the owned transaction reference after completion or disposal so a later operation can start a new transaction.
  • Keep successful and caller-owned transaction behavior unchanged.

Acceptance criteria

  • Tests cover action failure, failed rollback, failed commit, and successful repeated use of the unit of work.
  • The originally thrown exception remains observable after a failed rollback.
  • HrynCo.DAL.EF and relevant tests build and pass.

Package publication and the consuming API version update follow their separate approval and release gates.

Related Invemory bug: https://yt.hrynco.com/issue/IT-1588 The EF unit of work calls RollbackAsync after an action or CommitAsync fails. If PostgreSQL has already completed the transaction, rollback throws `NpgsqlTransaction has completed` and hides the original database error. Its cached transaction reference is also retained after disposal. Scope - Preserve the original action or commit exception if rollback also fails. - Clear the owned transaction reference after completion or disposal so a later operation can start a new transaction. - Keep successful and caller-owned transaction behavior unchanged. Acceptance criteria - Tests cover action failure, failed rollback, failed commit, and successful repeated use of the unit of work. - The originally thrown exception remains observable after a failed rollback. - HrynCo.DAL.EF and relevant tests build and pass. Package publication and the consuming API version update follow their separate approval and release gates.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hrynco/hrynco-ef#14