Bala's Development Blog

Thread was being aborted.


In my previous post I have suggested to increase the timeout value to prevent the
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding ” error. But after set the timeout value to 600 seconds I still get errors but this time “Thread was being aborted” error in my ASP.Net application.

This is because the ASP.Net web application itself have a timeout property which is by default is 180 seconds or 3 minutes which means its expect a response from the web server within the timeout or else it will abort the thread. So before the DB call timeout expired (which we set 600 sec) the ASP.NET hosting process aborts this thread after its timeout expired (default 180 sec).

So in order to avoid this we need to increase the httpRuntime executionTimeout to higher value than timeout for Data Access( Command Object or DataAdapter) .

How to set the http Runtime execution Timeout ?
Its easy to do this , open to web.config file of your web application. Under the system.web tag add this line

<httpRuntime executionTimeout="600" />

Its should be something similiar like this

    <httpRuntime executionTimeout="600" />