mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 01:14:13 +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.
|
/// \brief Commit all the operations of a transaction into the database.
|
||||||
void commit();
|
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;
|
using commit_latency = MDBX_commit_latency;
|
||||||
|
|
||||||
/// \brief Commit all the operations of a transaction into the database
|
/// \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();
|
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) {
|
bool txn::drop_map(const char *name, bool throw_if_absent) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user