# ADR-JPA-003 — Completion unknown is never retried - Status: Accepted; amended 2026-09-25 — `TransactionCompletionResolver`, `CommitFailureClassifier` and the retry engine were removed. The invariant holds because `SpringTransactionPort`, the only transaction engine, retries nothing; enforcement below is updated accordingly. - Date: 2026-08-11 - Design: §17 ## Context A connection can break while a commit is in flight. The server may have committed; the acknowledgement may simply have been lost. The driver cannot tell the two apart. ## Decision `TransactionCompletionUnknownException` is never retried, automatically or otherwise. It is produced only by a failure observed while the transaction phase is `COMMITTING`, and only for SQLSTATE `40003`, a connection-class (`08*`) state, or a transport break. Recovery is domain-specific reconciliation. ## Consequences Retrying a possibly-committed write is the most damaging thing this platform could do: a duplicate payment, a duplicate order, a double decrement. There is no budget or backoff that makes it safe, because the failure is epistemic rather than transient. The invariant is enforced at the type level rather than by policy alone. `JpaFailureContext` refuses to construct a retryable completion-unknown context, and the exception rebuilds its context through the safe factory whatever it is handed. A future policy bug therefore cannot produce an unsafe retry — the value it would need does not exist. The rule is deliberately narrow in the other direction too. Classifying every connection failure as completion-unknown would push ordinary pool exhaustion and server restarts into the reconciliation queue, which trains operators to clear that queue without reading it — and then the one entry that mattered gets cleared with the rest. The cost is that the domain must supply the resolver. The platform cannot: only the domain knows which idempotency record, business row, or outbox entry proves the write happened. ## Enforcement Production path: `SpringTransaction` records when the action has returned in a write transaction it began; a failure after that point goes through `PersistenceExceptionTranslator#translateCommitFailure`, which builds this exception for `08*`, `40003`, a vendor termination state (`SqlStateErrorMapping#commitOutcomeUnknownStates`, PostgreSQL `57P01`/`57P02`) or a transport break. Hibernate's flush inside the commit is not separated from the COMMIT itself, so a connection lost during that flush is also reported as unknown — the safe side. Until review 04-01 (2026-11-01) nothing constructed the exception and a commit-phase `08*` reached callers as the retryable `DB_UNAVAILABLE`. `JpaFailureContextTest`; `SpringTransactionTest`; `PersistenceExceptionTranslatorTest`; `PostgreSqlTransactionIntegrationTest#connectionLossDuringCommitSurfacesAsCompletionUnknownAndIsNeverRetried` (asserts `DB_COMPLETION_UNKNOWN`; also the `jpa-failure` lane, i.e. release gate `completion-unknown-no-retry`).