void MakeWritable() { if (_writing) { return; } if (_preapprovedWriting) { _writing = true; _preapprovedWriting = false; _keyValueDB.WriteStartTransaction(); return; } if (_readOnly) { throw new BTDBTransactionRetryException("Cannot write from readOnly transaction"); } var oldBTreeRoot = _btreeRoot; _btreeRoot = _keyValueDB.MakeWritableTransaction(this, oldBTreeRoot !); _keyValueDB.StartedUsingBTreeRoot(_btreeRoot); _keyValueDB.FinishedUsingBTreeRoot(oldBTreeRoot); _btreeRoot.DescriptionForLeaks = _descriptionForLeaks; _writing = true; InvalidateCurrentKey(); _keyValueDB.WriteStartTransaction(); }