Class: LMDB::Transaction
- Inherits:
-
Object
- Object
- LMDB::Transaction
- Defined in:
- ext/isomorfeus_hamster_ext/isomorfeus_hamster.c
Overview
The LMDB environment supports transactional reads and updates. By default, these provide the standard ACID (atomicity, consistency, isolation, durability) behaviors.
Transactions can be committed or aborted. When a transaction is committed, all its effects take effect in the database atomically. When a transaction is aborted, none of its effects take effect.
Transactions span the entire environment. All the updates made in the course of an update transaction – writing records across all databases, creating databases, and destroying databases – are either completed atomically or rolled back.
Transactions can be nested. A child transaction can be started within a parent transaction. The child transaction can commit or abort, at which point the effects of the child become visible to the parent transaction or not. If the parent aborts, all of the changes performed in the context of the parent – including the changes from a committed child transaction – are rolled back.
To create a transaction, call Environment#transaction and supply a block for the code to execute in that transaction.