I call a stored procedure via Linq-to-SQL. This stored procedure simply processes data that I've already inserted into another table. On large data sets, I get a timeout exception:
"Timeout expired. The timeout period elapsed prior to completion of the operation
or the server is not responding."
I can't do anything to speed the stored procedure up -- it's just moving data from one table to another. I don't particularly want to increase the timeout in the database connection string -- this is the only thing that takes a long time.
This isn't a web app; the stored procedure is called from a background thread in a normal Windows service. The background thread is kicked off by a WCF call, and the client periodically polls for the result of the background thread.
Unfortunately, the stored procedure takes too long, and the GetDataContext().spRunStoredProcedure()
call throws a TimeoutException
, even though the stored procedure appears to be running fine.
Can I increase the timeout just for this stored procedure call? Or is there a way to get the stored procedure to return "I'm not dead yet" to keep the connection from timing out?