Production engineering
Reveal answer and reasoning
A transaction retry boundary includes the reads that justified a write, not merely the final command that failed. In this SQLite WAL fixture, a read transaction can retain an older snapshot while another connection commits a new value. A stale reader attempting to become a writer can encounter a busy boundary. Retrying an UPDATE with the old decision does not refresh that snapshot.
The real lab records this behavior with separate actual connections. The companion uses ordinary copied values to explain fresh-decision arithmetic; it does not implement isolation, locking or an automatic retry provider.
Do not place an irreversible external action inside a replayed unit and assume a database rollback reverses it. An email, payment or remote mutation could already have happened before a transaction retry. Likewise, changing isolation or enabling shared-cache read-uncommitted behavior would alter the experiment and its guarantees. This fixture uses WAL and separate ordinary connections; it is not a SQL Server isolation demonstration.
A bounded retry should classify the real failure, abandon the stale transaction and recalculate from fresh state, while respecting cancellation and avoiding an unbounded loop that merely holds other resources longer. The recorded busy boundary is not a reason to retry syntax errors or every constraint rejection; those failures need independent classification before another attempt.
What a strong answer covers
- The portable program prints snapshot10, fresh20 and replayed21.
- The actual WAL reader and fresh connection observe different committed snapshots.
- A safe retry starts a fresh unit and repeats its dependent reads; it does not imply remote rollback.
Common pitfall
Retrying only the failed UPDATE while retaining a stale decision or repeating an external effect.
Follow-up questions
- Which transaction modes or providers would require different isolation evidence?
- What changes if the unit also sends a remote message before committing?
Self-review
Choose what to revisit. These marks are your own assessment and are separate from lesson completion.