Re: C# command doesn't time out appropriately...why?
- From: troylenparker@xxxxxxxxxxx
- Date: 11 Oct 2005 12:01:03 -0700
No, not a dumb question at all. I have executed this same query in a
different application...a Visual Basic application using ADO. The
specific parameters that we provided to the stored procedure are known
to take about 80 seconds to successfully complete. There is only one
record in our database that matches the search criteria, but it takes
about 80 seconds to successfully find the record. Our VB application
has a timeout set to 60 seconds, so that's how the problem originally
came to our attention. We knew that the matching record existed, but
only by increasing the timeout in our VB application, little by little,
to 80 seconds did the stored procedure call execute successfully.
We've spoken with our database administrator and they're going to do a
database reorg soon that will hopefully solve the problem.
So...we're trying to duplicate the same search in our web service
application, and since we know that this particular search will take
about 80 seconds to complete, I used the same parameters to test the
timeout feature of this web service routine (the code I posted above).
But...so I didn't have to agonizingly wait a full minute during my
testing, I just simply changed the CommandTimeout parameter to 5
seconds to get it to time out almost immediately and verify that the
timeout was working correctly.
I'm basically trying to execute the command, which of course is a call
to a stored procedure with the command parameters set appropriately.
If the command times out - in this example, in 5 seconds - I'd like to
cancel the command and return an error to the client notifying them
that the search timed out. And then, of course, if the command is
successful, I'd like to populate a DataSet object and return this
populated object as the return value of my function.
I know that there is only one matching record in the database, so upon
locating the record, it shouldn't take it but a microsecond to populate
the DataSet. But the command never times out after five seconds...I
put my watch on it and it takes up to the full 80 seconds before
control is returned to the next line of code after the line:
daRequest.Fill(dsReturnSet);
Hope that helps describe the problem in more detail...based on that,
any idea why the CommandTimeout would fail?
.
- References:
- Re: C# command doesn't time out appropriately...why?
- From: W.G. Ryan - MVP
- Re: C# command doesn't time out appropriately...why?
- Prev by Date: .Net -> DB2
- Next by Date: SQlHelper vs SqlClient
- Previous by thread: Re: C# command doesn't time out appropriately...why?
- Next by thread: .Net -> DB2
- Index(es):
Relevant Pages
|