示例#1
0
 public void Dispose()
 {
     _env.TransactionCompleted(_id);
     foreach (var pagerState in _pagerStates)
     {
         pagerState.Release();
     }
 }
        public void Dispose()
        {
            if (!Committed && !RolledBack && Flags == TransactionFlags.ReadWrite)
            {
                Rollback();
            }

            _env.TransactionCompleted(this);
            foreach (var pagerState in _pagerStates)
            {
                pagerState.Release();
            }
        }
示例#3
0
        public void Dispose()
        {
            if (_disposed.HasFlag(TxState.Disposed))
            {
                return;
            }

            try
            {
                if (!Committed && !RolledBack && Flags == TransactionFlags.ReadWrite)
                {
                    Rollback();
                }

                _disposed |= TxState.Disposed;

                PersistentContext.FreePageLocator(_pageLocator);
            }
            finally
            {
                _env.TransactionCompleted(this);

                foreach (var pagerState in _pagerStates)
                {
                    pagerState.Release();
                }

                if (JournalFiles != null)
                {
                    foreach (var journalFile in JournalFiles)
                    {
                        journalFile.Release();
                    }
                }

                _root?.Dispose();
                _freeSpaceTree?.Dispose();

                _allocator.AllocationFailed -= MarkTransactionAsFailed;
                if (_disposeAllocator)
                {
                    _allocator.Dispose();
                }

                OnDispose?.Invoke(this);
            }
        }
示例#4
0
        public void Dispose()
        {
            if (!Committed && !RolledBack && Flags == TransactionFlags.ReadWrite)
            {
                Rollback();
            }

            _env.TransactionCompleted(this);
            foreach (var pagerState in _pagerStates)
            {
                pagerState.Release();
            }
            if (Environment.IsDebugRecording)
            {
                RecordTransactionState(this, DebugActionType.TransactionDisposed);
            }
        }
示例#5
0
        public void Dispose()
        {
            if (_disposed)
            {
                return;
            }

            if (!Committed && !RolledBack && Flags == TransactionFlags.ReadWrite)
            {
                Rollback();
            }

            _disposed = true;

            if (Flags == TransactionFlags.ReadWrite)
            {
                _env.WriteTransactionPool.Reset();
            }

            _env.TransactionCompleted(this);

            foreach (var pagerState in _pagerStates)
            {
                pagerState.Release();
            }

            _root?.Dispose();
            _freeSpaceTree?.Dispose();

            if (_disposeAllocator)
            {
                _allocator.Dispose();
            }

            OnDispose?.Invoke(this);
        }