I'm running an SQL query against a mainframe DB2 database using the OdbcDataReader class and ExecuteReader() method. This code is in production and has been running fine for months.
The query normally takes 1-2 minutes to execute. This past Friday, the query encountered a ThreadAbortException. Below is the formatted stack trace. The ApplicationException in the trace is created in my catch block.
In case it is important, the query is run when a client calls a web service method. The web service is hosted in a Windows Service. The web service is hosted in a Windows Service using the soap.tcp protocol.
Any ideas why the TreadAbortException is happening?
Stack trace for 2 exception(s). Root cause at the top.
Exception 2: Thread was being aborted.
System.Threading.ThreadAbortException inside C:\WINDOWS\assembly\GAC_64\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll at System.Data.Common.UnsafeNativeMethods.SQLExecDirectW(OdbcStatementHandle StatementHandle, String StatementText, Int32 TextLength) at System.Data.Odbc.OdbcStatementHandle.ExecuteDirect(String commandText) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader) at System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior) at MyCompany.MyDatabase.GetFolioList(String sqlWhereClause)Exception 1: Unable to retrieve the folio summary list where STAT_CD='V'.
System.ApplicationException inside D:\Production\DBGateway\bin\MyDatabase.dll at MyCompany.MyDatabase.GetFolioList(String sqlWhereClause) at MyCompany.MyDatabase.<>c__DisplayClass18.b__17() at MyCompany.WebUtilities.WebServiceBase.WebMethodTemplate1 Worker, StringFormatter1 FormatterMethod">T