private void TransactionAfterCommit(Transaction tx) { if (_activeTransactions.Contains(tx) == false) return; _txCommit.EnterWriteLock(); try { if (tx.Committed && tx.FlushedToJournal) _transactionsCounter = tx.Id; State = tx.State; } finally { _txCommit.ExitWriteLock(); } if (tx.FlushedToJournal == false) return; var totalPages = 0; // ReSharper disable once LoopCanBeConvertedToQuery foreach (var page in tx.GetTransactionPages()) { totalPages += page.NumberOfPages; } Interlocked.Add(ref _sizeOfUnflushedTransactionsInJournalFile, totalPages); _flushWriter.Set(); }
private void TransactionAfterCommit(Transaction tx) { if (_activeTransactions.Contains(tx) == false) return; _txCommit.EnterWriteLock(); try { if (tx.Committed && tx.FlushedToJournal) _transactionsCounter = tx.Id; State = tx.State; } finally { _txCommit.ExitWriteLock(); } if (tx.FlushedToJournal == false) return; Interlocked.Add(ref _sizeOfUnflushedTransactionsInJournalFile, tx.GetTransactionPages().Sum(x => x.NumberOfPages)); _flushWriter.Set(); }