|
|
@ -50,6 +50,15 @@ public: |
|
|
|
void Flush(bool fShutdown); |
|
|
|
void Flush(bool fShutdown); |
|
|
|
void CheckpointLSN(std::string strFile); |
|
|
|
void CheckpointLSN(std::string strFile); |
|
|
|
void SetDetach(bool fDetachDB_) { fDetachDB = fDetachDB_; } |
|
|
|
void SetDetach(bool fDetachDB_) { fDetachDB = fDetachDB_; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DbTxn *TxnBegin(DbTxn *baseTxn, int flags=DB_TXN_WRITE_NOSYNC) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
DbTxn* ptxn = NULL; |
|
|
|
|
|
|
|
int ret = dbenv.txn_begin(baseTxn, &ptxn, flags); |
|
|
|
|
|
|
|
if (!ptxn || ret != 0) |
|
|
|
|
|
|
|
return NULL; |
|
|
|
|
|
|
|
return ptxn; |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
extern CDBEnv bitdb; |
|
|
|
extern CDBEnv bitdb; |
|
|
@ -237,9 +246,8 @@ public: |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!pdb) |
|
|
|
if (!pdb) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
DbTxn* ptxn = NULL; |
|
|
|
DbTxn* ptxn = bitdb.TxnBegin(GetTxn()); |
|
|
|
int ret = bitdb.dbenv.txn_begin(GetTxn(), &ptxn, DB_TXN_WRITE_NOSYNC); |
|
|
|
if (!ptxn) |
|
|
|
if (!ptxn || ret != 0) |
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
vTxn.push_back(ptxn); |
|
|
|
vTxn.push_back(ptxn); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|