Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discard tx on commit/abort in case of an error too #3

Merged
merged 1 commit into from
Jul 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lmdb++.h
Original file line number Diff line number Diff line change
Expand Up @@ -1208,8 +1208,9 @@ class lmdb::txn {
* @post `handle() == nullptr`
*/
void commit() {
lmdb::txn_commit(_handle);
auto h = _handle;
_handle = nullptr;
lmdb::txn_commit(h);
}

/**
Expand All @@ -1218,8 +1219,9 @@ class lmdb::txn {
* @post `handle() == nullptr`
*/
void abort() noexcept {
lmdb::txn_abort(_handle);
auto h = _handle;
_handle = nullptr;
lmdb::txn_abort(h);
}

/**
Expand Down