Skip to main content

Module tx_atomic_stmt

Module tx_atomic_stmt 

Source

Functions§

create_with_has_many_rolls_back_on_failure
When the second INSERT in a has_many create plan fails (unique constraint), the driver should receive Transaction::Rollback and no orphaned user should remain in the database.
create_with_has_one_rolls_back_on_failure
Same rollback guarantee for a has_one association create.
multi_op_create_wraps_in_transaction
A multi-op create (user + associated todo) should be wrapped in BEGIN … COMMIT so the driver sees all three transaction operations.
rmw_condition_failure_issues_rollback_to_savepoint
When a standalone RMW condition fails (todo doesn’t belong to this user), the driver should receive ROLLBACK on the RMW’s own transaction. On PostgreSQL the CTE handles this in a single statement.
rmw_uses_savepoints
A successful standalone conditional update (link/unlink) wraps itself in its own BEGIN…COMMIT on drivers that don’t support CTE-with-update (SQLite, MySQL). When nested inside an outer transaction it uses savepoints instead. On PostgreSQL the same operation is a single CTE-based QuerySql.
single_op_skips_transaction
A single-op create (no associations) must NOT be wrapped in a transaction — the engine skips the overhead for plans with only one DB operation.
update_with_new_association_rolls_back_on_failure
When an update + new-association plan fails on the UPDATE (after the INSERT succeeds), the INSERT must also be rolled back.