Esempio n. 1
0
        public void Dispose()
        {
            disposerLock.EnterWriteLock();
            try
            {
                if (disposed)
                {
                    return;
                }
                disposed = true;
                current.Dispose();

                if (tableStorage != null)
                {
                    tableStorage.Dispose();
                }

                if (bufferPool != null)
                {
                    bufferPool.Dispose();
                }
            }
            finally
            {
                disposerLock.ExitWriteLock();
            }
        }
Esempio n. 2
0
        public void Dispose()
        {
            disposerLock.EnterWriteLock();
            try
            {
                if (disposed)
                {
                    return;
                }

                disposed = true;

                var exceptionAggregator = new ExceptionAggregator("Could not properly dispose TransactionalStorage");

                exceptionAggregator.Execute(() => current.Dispose());

                if (tableStorage != null)
                {
                    exceptionAggregator.Execute(() => tableStorage.Dispose());
                }

                if (bufferPool != null)
                {
                    exceptionAggregator.Execute(() => bufferPool.Dispose());
                }

                exceptionAggregator.ThrowIfNeeded();
            }
            finally
            {
                disposerLock.ExitWriteLock();
            }
        }