Database Transaction and Atomicity Failures
Only some database operations commit on error, leaving incomplete records, inconsistent relationships, or partially updated data.
Failure explanation
A single API operation performs multiple related database changes, but an error causes only some of them to persist. This can leave orphan records, inconsistent totals, broken relationships, or a business operation that appears complete when it is not. Problems may also arise from incorrect transaction boundaries, isolation levels, or handling of concurrent updates.
Example
Creating an invoice inserts the invoice header and then fails while inserting its line items. The API returns an error, but the header remains committed with no lines, and downstream reporting treats it as a valid invoice.
How to test
- Inject failures between database writes and verify rollback behavior.
- Test constraint violations, deadlocks, concurrent transactions, and transaction isolation.
- Inspect persisted state after both success and failure.
- Distinguish single-database atomicity from multi-service workflows, which need separate distributed coordination.
Expected behavior
Operations documented as atomic either commit all required changes or leave no partial state. Where atomicity is not possible, the API exposes a recoverable workflow and consistent status.
Runnable examples
Each example includes a broken server, a fixed server, an OpenAPI spec, and a clrsig scenario that detects the failure.
In the field
- STORY-040 primary The Invoice Header That Survived Without Its Line Items
- STORY-020 related The Order That Was Paid For but Never Shipped
- STORY-021 related The Upload That Passed the API but Never Reached the Archive
- STORY-025 related The HTTP 200 That Made a Failed Transfer Look Successful
- STORY-027 related The Update That Quietly Overwrote Someone Else's Changes
- STORY-029 related The Bulk Request That Was Only Partially Successful
- STORY-038 related The Confirmation API That Read Yesterday's Balance