Exemplo n.º 1
0
        /// <summary>
        /// Releases all resources used by the <see cref="AseConnection" />.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (_isDisposed)
            {
                return;
            }

            if (_transaction != null && !_transaction.IsDisposed)
            {
                _transaction.Dispose(); // Will also rollback the transaction
            }

            _transaction = null;

            try
            {
                Close();

                // Kill listening references that might keep this object from being garbage collected.
                StateChangeInternal = null;
                InfoMessageInternal = null;
                TraceEnterInternal  = null;
                TraceExitInternal   = null;
            }
            finally
            {
                _isDisposed = true;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Releases all resources used by the <see cref="AseConnection" />.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (_isDisposed)
            {
                return;
            }

            if (_transaction != null && !_transaction.IsDisposed)
            {
                _transaction.Dispose(); // Will also rollback the transaction
            }

            _transaction = null;

            try
            {
                Close();

                // Kill listening references that might keep this object from being garbage collected.
                _eventNotifier.ClearAll();
            }
            finally
            {
                _isDisposed = true;
            }
        }