Skip to main content

Module transaction

Module transaction 

Source
Expand description

Transaction abstraction for atomic multi-write operations.

Most trait methods manage their own connection (checkout โ†’ execute โ†’ return). When multiple writes must be atomic, callers use begin_transaction() to get a Transaction that routes all operations through a single database connection with explicit commit/rollback.

Transaction is NOT Send/Sync โ€” it holds a database connection and must be used within a single task. This is intentional: transactions are scoped operations, not shared state.

Traitsยง

Transaction
A scoped database transaction. Commits on .commit(), rolls back on drop if not committed.
Transactional
Ability to start a transaction. Implemented by DatabaseHandler.