mdbx++: добавление txn::commit_embark_read().

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2023-11-21 15:17:07 +03:00
parent b9e2f6dc09
commit 55142d8d6f
2 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -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) {