mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-29 23:19:20 +08:00
mdbx++: добавление txn::commit_embark_read()
.
This commit is contained in:
parent
b9e2f6dc09
commit
55142d8d6f
4
mdbx.h++
4
mdbx.h++
@ -4318,6 +4318,10 @@ public:
|
||||
/// \brief Commit all the operations of a transaction into the database.
|
||||
void commit();
|
||||
|
||||
/// \brief Commit all the operations of a transaction into the database
|
||||
/// and then start read transaction.
|
||||
void commit_embark_read();
|
||||
|
||||
using commit_latency = MDBX_commit_latency;
|
||||
|
||||
/// \brief Commit all the operations of a transaction into the database
|
||||
|
@ -1555,6 +1555,13 @@ void txn_managed::commit(commit_latency *latency) {
|
||||
MDBX_CXX20_UNLIKELY err.throw_exception();
|
||||
}
|
||||
|
||||
void txn_managed::commit_embark_read() {
|
||||
auto env = this->env();
|
||||
commit();
|
||||
error::success_or_throw(
|
||||
::mdbx_txn_begin(env, nullptr, MDBX_TXN_RDONLY, &handle_));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
bool txn::drop_map(const char *name, bool throw_if_absent) {
|
||||
|
Loading…
Reference in New Issue
Block a user