user263329
user263329

Reputation: 11

Thread abort exception

I am having an issue in webservice which resides in mono. I am having a webservice which process huge database operation. I have given "Timeout = 1024" in the "webconfig" file under "appSettings" tag.

When call is done to the webservice after 2 minuter i am getting "thread abort exception".

please help me to overcome this problem

regards Kumaran

Upvotes: 1

Views: 2498

Answers (3)

Matt Kocaj
Matt Kocaj

Reputation: 11535

Check the innerexception. That's supposed to have some sort of HttpApplication.CancelModelException that should contain a flag indicating if it's a timeout or not. Either way, if you do have an innerexception it may provide more insight.

Additionally, make sure your method is set to async.

Upvotes: 1

Guffa
Guffa

Reputation: 700152

You want to set the request timeout also. This is something like 30 or 60 seconds by default.

In the system.web section, set something like:

<httpRuntime executionTimeout="200"/>

This will affect all the pages, so perhaps you want to put the page in a separate folder so that you can have a local web.config file for this setting.

Upvotes: 2

Dewfy
Dewfy

Reputation: 23614

It is bad practice to place long operations (in your case it is over 2 mins) to synchronous web service method. Usually web service is only facade to start long time method on back-end server or at least another thread. Client can periodcally check if operation is done (so called watchdog pattern). Or review possibility to use oneway method - when client doesn't care about result at all.

By the way, NOTE, even succeed operation in web request must finish with ThreadAbort exception - since HttpRequest contains it raising at end of request processing

Upvotes: 1

Related Questions