override protected void DispatchMessages(bool ignoreNonFatalMessages) { // Override this on the Connection event sink, since we can deal // with info messages here. SqlException exception = ProcessMessages(false, ignoreNonFatalMessages); if (null != exception) { // SQLBUVSTS 225982, query for connection once to avoid race condition between GC (that may collect the connection) and the user thread SqlConnection connection = _connection.Connection; if (null != connection && connection.FireInfoMessageEventOnUserErrors) { connection.OnInfoMessage(new SqlInfoMessageEventArgs(exception)); } else { _connection.OnError(exception, false); // we can't really ever break the direct connection, can we? } } }