The workshop’s approval changes a record and records history. An extension may also record a policy decision. It is tempting to call the whole request atomic. The useful question is more specific: which writes share a transaction, and what can still fail after those writes commit?
A transaction groups a set of database effects. It does not automatically include another store, a notification, an after-action extension, or a remote service. The definition of the group determines which invariant the transaction can protect.
Atomicity is local to the group
If an approval row and its required evidence row share one transaction, a failure can roll both back. If evidence is written afterward, the approval can survive without that evidence. The current policy permit record uses the latter ordering. The history and mutation paths have their own behavior and should be inspected separately.
The handbook lab observes a successful approval, two history events, and a policy permit. It does not inject a storage failure at every commit stage. Therefore its result demonstrates those successful effects, not universal atomic evidence completeness. The distinction belongs beside the claim rather than hidden in a final disclaimer.
Concurrent requests add another obligation
Imagine a workshop with one remaining inspection slot. Two requests each read that one slot is available. Each performs an internally atomic reservation. Without a shared conflict or suitable isolation, both can succeed and oversubscribe the slot.
The problem is not a partial transaction. It is that two individually acceptable decisions were based on a condition they could invalidate together. A correct reservation protocol must protect the predicate across transactions, for example through a guarded update, appropriate locking, or a serializable protocol whose retries are handled correctly.
The same reasoning applies to approval. A client can read a submitted record and then act after another request has changed its state. The server must revalidate the relevant state as part of the mutation. A preflight GET is useful for the interface, but it is not a synchronization mechanism.
Optimistic version checks are a contract
An expected version communicates which state the caller intended to change. The service must compare it at the right point and return a conflict if it no longer matches. The client must then decide whether to reread, ask the user, or abandon the task.
Blindly retrying with the latest version defeats the user’s original condition. If Bob approved revision 1, a client should not silently convert that intention into approval of revision 2. A retry must preserve the meaning of the operation, not merely obtain a successful status code.
The calibration example avoids mutable measured content by using immutable candidate fields. This simplifies one dimension of the problem. It does not demonstrate every interleaving of simultaneous approvals, nor does it reserve an instrument or inspection slot.
Idempotency concerns repeated intent
A caller can lose a response after a successful mutation. Retrying may create a second record or perform a second external effect unless the operation has a tested idempotency contract. A unique request identifier helps only if the service stores and checks it consistently with the effect.
Distinguish an operation that is naturally idempotent from one that is merely safe in the example’s happy path. Repeating a GET is different from creating a calibration candidate, and repeating approval after certification may be refused rather than return the original success. Document that behavior so clients can recover deliberately.
Write a failure table before a performance claim
For each important operation, identify the state before the request, the transaction’s effects, the post-commit work, and the recovery action for each failure. This table often reveals a missing state such as delivery pending or evidence reconciliation required.
Then test the store you intend to deploy. SQLite evidence does not by itself establish PostgreSQL isolation behavior, and a sequential test does not establish concurrent safety. The current runtime handlers and transaction scope show where to begin tracing the implementation.
Workshop
Specify a maximum of ten pending calibrations per instrument. Construct an execution in which two creates both see nine pending records. Propose a commit-time mechanism that prevents eleven, and name the concurrent test that would distinguish it from an ordinary pre-insert count.