internal void CommitWrittingTransaction(IRootNode artRoot) { lock (_writeLock) { _writingTransaction = null; if (_lastCommited.Dereference()) { _lastCommited.Dispose(); } _lastCommited = artRoot; TryDequeWaiterForWrittingTransaction(); } }
internal void DereferenceRoot(IRootNode currentArtRoot) { if (currentArtRoot.Dereference()) { _waitingToDispose.Add(currentArtRoot); } }
internal IRootNode MakeWrittableTransaction(ArtInMemoryKeyValueDBTransaction keyValueDBTransaction, IRootNode artRoot) { lock (_writeLock) { if (_writingTransaction != null) { throw new BTDBTransactionRetryException("Another writting transaction already running"); } if (LastCommited != artRoot) { throw new BTDBTransactionRetryException("Another writting transaction already finished"); } _writingTransaction = keyValueDBTransaction; var result = _lastCommited; _lastCommited = result.Snapshot(); artRoot.Dereference(); return(result); } }