|
Database System 0.1.0
Advanced C++20 Database System with Multi-Backend Support
|
RAII transaction guard that rolls back on destruction unless committed. More...

Public Member Functions | |
| transaction_guard (std::shared_ptr< database_manager > mgr) | |
| ~transaction_guard () | |
| void | commit () |
| transaction_guard (const transaction_guard &)=delete | |
| transaction_guard & | operator= (const transaction_guard &)=delete |
Private Attributes | |
| std::shared_ptr< database_manager > | mgr_ |
| bool | committed_ |
RAII transaction guard that rolls back on destruction unless committed.
This pattern ensures that transactions are never left dangling even when an exception or early return occurs.
Definition at line 36 of file transaction_management.cpp.
|
inlineexplicit |
Definition at line 39 of file transaction_management.cpp.
References mgr_.
|
inline |
Definition at line 49 of file transaction_management.cpp.
References committed_, and mgr_.
|
delete |
|
inline |
Definition at line 58 of file transaction_management.cpp.
References committed_, and mgr_.
Referenced by main().

|
delete |
|
private |
Definition at line 77 of file transaction_management.cpp.
Referenced by commit(), and ~transaction_guard().
|
private |
Definition at line 76 of file transaction_management.cpp.
Referenced by commit(), transaction_guard(), and ~transaction_guard().