Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Hugo Beauzée-Luyssen
medialibrary
Commits
b0c65209
Commit
b0c65209
authored
Jun 17, 2022
by
Hugo Beauzée-Luyssen
Browse files
sqlite: Transaction: Add documentation
parent
59fad0a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/database/SqliteTransaction.h
View file @
b0c65209
...
...
@@ -34,11 +34,26 @@ namespace medialibrary
namespace
sqlite
{
/**
* @brief The Transaction class represents an abstract transaction.
*
* When no transaction is opened, the associated factory (Connection::newTransaction)
* will instantiate an ActualTransaction, which executes begin/commit
* Later instantiation while a transaction is already opened will result in a
* NoopTransaction which does nothing but simplifies the code path for the caller.
*/
class
Transaction
{
public:
Transaction
()
=
default
;
/**
* If a transaction is in progress and hasn't been commited, the destructor
* will issue a ROLLBACK
*/
virtual
~
Transaction
()
=
default
;
/**
* @brief commit Commits all pending changes to the database
*/
virtual
void
commit
()
=
0
;
/**
* @brief commitNoUnlock This will commit the current transaction but will
...
...
@@ -46,6 +61,9 @@ public:
*/
virtual
void
commitNoUnlock
()
=
0
;
/**
* @brief isInProgress Returns true if a transaction is opened by the current thread
*/
static
bool
isInProgress
();
Transaction
(
const
Transaction
&
)
=
delete
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment