ORMQueryExecutionException: thread aborted on SQL Server

Posts   
 
    
JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 19-Jan-2013 22:35:29   

I have this issue consistently. It appears to be a SQL Server problem, but I was just wondering if anybody has any insight. I pulled out the query and manually ran it, and it took under a second, returning less than a dozen rows.

I just converted the project from 2.6 to 3.5, hoping that maybe the problem would magically go away. I'm targeting .NET 4.0, on SQL Server 2005 (9.00.5266.00).

Wow, I didn't realize the customer was running such an old version of SQL Server until I created this post. I wonder if simply upgrading would fix the problem.

Jim

SD.LLBLGen.Pro.ORMSupportClasses.ORMQueryExecutionException: An exception was caught during the execution of a retrieval query: Thread was being aborted.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception. ---> System.Threading.ThreadAbortException: Thread was being aborted. at SNIReadSync(SNI_Conn* , SNI_Packet** , Int32 ) at SNINativeMethodWrapper.SNIReadSync(SafeHandle pConn, IntPtr& packet, Int32 timeout) at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket() at System.Data.SqlClient.TdsParserStateObject.ReadBuffer() at System.Data.SqlClient.TdsParserStateObject.ReadByte() at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) at SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior) --- End of inner exception stack trace --- at SD.LLBLGen.Pro.ORMSupportClasses.RetrievalQuery.Execute(CommandBehavior behavior) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.ExecuteMultiRowDataTableRetrievalQuery(IRetrievalQuery queryToExecute, DbDataAdapter dataAdapterToUse, DataTable tableToFill, IFieldPersistenceInfo[] fieldsPersistenceInfo) at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.FetchTypedList(IEntityFields2 fieldCollectionToFetch, DataTable dataTableToFill, IRelationPredicateBucket filterBucket, Int32 maxNumberOfItemsToReturn, ISortExpression sortClauses, Boolean allowDuplicates, IGroupByCollection groupByClause, Int32 pageNumber, Int32 pageSize) at Chevron.GlobalMetrics.Reporting.Reports.MetricProviders.Metric70MetricProvider.ProcessSBUTarget(SBUEntity sbu)

[rest elided]

JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 19-Jan-2013 22:37:26   

Here are the contents of the QueryExecuted property:

Query: SELECT SUM(([GlobalMetricsP].[dbo].[AllMetricValues].[Value] * @p2)) AS [Total], [GlobalMetricsP].[dbo].[AllMetricValues].[Year], [GlobalMetricsP].[dbo].[AllMetricValues].[ReportingEntityID], [GlobalMetricsP].[dbo].[AllMetricValues].[DrillingCategoryNumber] FROM [GlobalMetricsP].[dbo].[AllMetricValues] WHERE ( ( ( ( ( ( ( [GlobalMetricsP].[dbo].[AllMetricValues].[ReportingEntityID] = @p3) OR [GlobalMetricsP].[dbo].[AllMetricValues].[ReportingEntityID] = @p4) OR [GlobalMetricsP].[dbo].[AllMetricValues].[ReportingEntityID] = @p5) OR [GlobalMetricsP].[dbo].[AllMetricValues].[ReportingEntityID] = @p6) OR [GlobalMetricsP].[dbo].[AllMetricValues].[ReportingEntityID] = @p7) AND [GlobalMetricsP].[dbo].[AllMetricValues].[MetricID] = @p8 AND [GlobalMetricsP].[dbo].[AllMetricValues].[Year] = @p9)) GROUP BY [GlobalMetricsP].[dbo].[AllMetricValues].[Year], [GlobalMetricsP].[dbo].[AllMetricValues].[ReportingEntityID], [GlobalMetricsP].[dbo].[AllMetricValues].[DrillingCategoryNumber] ORDER BY [GlobalMetricsP].[dbo].[AllMetricValues].[Year] ASC,[GlobalMetricsP].[dbo].[AllMetricValues].[ReportingEntityID] ASC,[GlobalMetricsP].[dbo].[AllMetricValues].[DrillingCategoryNumber] ASC Parameter: @p2 : Int32. Length: 0. Precision: 0. Scale: 0. Direction: Input. Value: 1. Parameter: @p3 : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 14. Parameter: @p4 : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 15. Parameter: @p5 : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 16. Parameter: @p6 : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 17. Parameter: @p7 : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 32. Parameter: @p8 : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 71. Parameter: @p9 : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 2012.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 21-Jan-2013 04:08:46   
David Elizondo | LLBLGen Support Team
JimFoye avatar
JimFoye
User
Posts: 656
Joined: 22-Jun-2004
# Posted on: 21-Jan-2013 20:36:56   

I had thought maybe it was a timeout problem, but was unsure because of the exception. Per the first link, I made an addition to web.config:

  <system.web>
    <httpRuntime maxRequestLength="8092" executionTimeout="900"/> 

(I increased the maxRequestLength to possibly solve a separate issue).

The report now runs. Thanks! Jim