Transactions
Hint
This article is generated by AI translation.
dbVisitor includes a lightweight local transaction manager that supports all 7 transaction propagation behaviors and 5 isolation levels. You can control transactions in three ways; the specific choice depends on your project requirements.
Usage Guide
Concepts
- Local Transaction Manager: understand how the dbVisitor transaction manager works and the transaction stack mechanism.
- Propagation Behavior: understand the differences and applicable scenarios of the 7 propagation behaviors.
- Isolation Levels: understand how different isolation levels affect concurrent reads and writes.
How to use
- Programmatic Transactions: manually call
begin/commit/rollBackto control transactions — flexible but more verbose. - Transaction Template: execute transaction code blocks via
TransactionTemplate, with automatic commit/rollback handling. - Annotation-based Transactions: declaratively control transactions via
@Transactionalannotations — the most concise code.