Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intermittent "batch is aborted" exceptions

I have a .NET 4.0 database-centric application (thick client, WinForms) running against SQL Server (mostly via Linq to Sql with some vanilla ADO.NET sprinkled in) that is deployed in hundreds of environments (each maintained by our customers' IT staff). The application is a rewrite of my company's legacy FoxPro product which was in use for many years.

The application seems to be working fine for all of our customers except one, which is having intermittent exceptions like so:

System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

The request failed to run because the batch is aborted, this can be caused by abort signal sent from client, or another request is running in the same session, which makes the session busy.

Everything I can find on the web about this (such as here and here) say this problem is a SQL Server 2005 bug that was resolved in SP1. However, this customer is using SQL Server 2008 R2 Express (this has been verified by our company; we aren't just taking the customer's word for it). Additionally, we are not using connection pooling or distributed transactions, so the links I found seem even less relevant.

Again, the problems are intermittent (a few times per day), and occur on all of their various workstations (seeming to indicate that it is not an issue with a single client). The legacy FoxPro application is still present in their environment and works fine (against the exact same database), which would seem to indicate that it is not solely a network or database server issue.

Any help would be greatly appreciated.

like image 798
Pennidren Avatar asked Aug 03 '12 15:08

Pennidren


1 Answers

These errors indicate that the CommandTimeout is reached (default is 30 seconds) before the server returns results. This does not indicate any bug and no SP can solve it. This is a performance problem (most likely missing indexes) and must be investigated as a performance problem. Try following the SQLCAT performance troubleshooting flowchart.

like image 120
Remus Rusanu Avatar answered Oct 04 '22 19:10

Remus Rusanu