summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdbx/src/dbutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Dbx_mdbx/src/dbutils.cpp')
-rw-r--r--plugins/Dbx_mdbx/src/dbutils.cpp54
1 files changed, 0 insertions, 54 deletions
diff --git a/plugins/Dbx_mdbx/src/dbutils.cpp b/plugins/Dbx_mdbx/src/dbutils.cpp
index a1a758a53b..472628bf0a 100644
--- a/plugins/Dbx_mdbx/src/dbutils.cpp
+++ b/plugins/Dbx_mdbx/src/dbutils.cpp
@@ -55,41 +55,6 @@ int DBSettingKey::Compare(const MDBX_val *ax, const MDBX_val *bx) MDBX_CXX17_NOE
}
/////////////////////////////////////////////////////////////////////////////////////////
-// txn_ptr_ro class
-
-txn_ptr_ro::txn_ptr_ro(CMDBX_txn_ro &_txn) :
- txn(_txn),
- lock(txn.cs)
-{
- for (int nRetries = 0; nRetries < 5; nRetries++) {
- int rc = mdbx_txn_renew(txn);
- if (rc == MDBX_SUCCESS)
- break;
-
- #ifdef _DEBUG
- DebugBreak();
- #endif
- Netlib_Logf(nullptr, "txn_ptr_ro::txn_ptr_ro failed with error=%d, retrying...", rc);
- Sleep(0);
- }
-}
-
-txn_ptr_ro::~txn_ptr_ro()
-{
- for (int nRetries = 0; nRetries < 5; nRetries++) {
- int rc = mdbx_txn_reset(txn);
- if (rc == MDBX_SUCCESS)
- break;
-
- #ifdef _DEBUG
- DebugBreak();
- #endif
- Netlib_Logf(nullptr, "txn_ptr_ro::~txn_ptr_ro failed with error=%d, retrying...", rc);
- Sleep(0);
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
// txn_ptr class
txn_ptr::txn_ptr(CDbxMDBX *_db) :
@@ -101,29 +66,10 @@ txn_ptr::txn_ptr(CDbxMDBX *_db) :
txn_ptr::~txn_ptr()
{
- if (txn)
- Abort();
-
pDb->m_csDbAccess.Unlock();
}
int txn_ptr::Commit()
{
- int rc = mdbx_txn_commit(txn);
- if (rc != MDBX_SUCCESS) {
- /* FIXME: throw an exception */
- Abort();
- return rc;
- }
- txn = nullptr;
return MDBX_SUCCESS;
}
-
-void txn_ptr::Abort()
-{
- int rc = mdbx_txn_abort(txn);
- /* FIXME: throw an exception */
- _ASSERT(rc == MDBX_SUCCESS);
- UNREFERENCED_PARAMETER(rc);
- txn = nullptr;
-}