예제 #1
0
        protected override void Dispose(bool disposing)
        {
            //  done already?
            if (_disposed)
            {
                return;
            }

            try
            {
                if (disposing)
                {
                    // before closing
                    RollbackOpenTransactions();
                    _transaction?.Dispose();

                    // we are now closed
                    _connectionState = ConnectionState.Closed;
                    _connectionBuilder.Dispose();

                    // all done.
                    _disposed = true;
                }
            }
            finally
            {
                // tell the parent to do the same.
                base.Dispose(disposing);
            }
        }