public void Commit() { if (BtreeRoot == null) { throw new BTDBException("Transaction already commited or disposed"); } InvalidateCurrentKey(); var currentBtreeRoot = _btreeRoot; _keyValueDB.FinishedUsingBTreeRoot(_btreeRoot); _btreeRoot = null; GC.SuppressFinalize(this); if (_preapprovedWriting) { _preapprovedWriting = false; _keyValueDB.RevertWritingTransaction(true); } else if (_writing) { _keyValueDB.CommitWritingTransaction(currentBtreeRoot, _temporaryCloseTransactionLog); _writing = false; } }