Пример #1
0
 internal void CommitWrittingTransaction(IRootNode artRoot)
 {
     lock (_writeLock)
     {
         _writingTransaction = null;
         if (_lastCommited.Dereference())
         {
             _lastCommited.Dispose();
         }
         _lastCommited = artRoot;
         TryDequeWaiterForWrittingTransaction();
     }
 }
Пример #2
0
 internal void DereferenceRoot(IRootNode currentArtRoot)
 {
     if (currentArtRoot.Dereference())
     {
         _waitingToDispose.Add(currentArtRoot);
     }
 }
Пример #3
0
 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);
     }
 }