[dba-VB] C# SQLCommand.Timeout

Mark Breen marklbreen at gmail.com
Tue Dec 1 09:49:01 CST 2009


Hello John,

Not sure, but stopping the server is one way.  My main problems were sprocs
stopping when I did not want them to stop, for me, if it is still running
after 24 hours, it is probably never going to stop.  For you, you might
increase that to 48 hours, but in general, they either finish promptly, or
else will never finish, either way, timing out after 10, 20, 50, or even 600
minutes is almost never a good option, if there is a possibility that it
will finish in 601 minutes.

There is probably a way to stop a process, Francisco or some of the other
experts may know how, but I would either stop the db server / service, or
else in worst case, do a quick reboot.  For the rest of the year, I would
never worry about it, happy in the knowledge they the server must work till
the death :)

Thanks

Mark






2009/12/1 jwcolby <jwcolby at colbyconsulting.com>

> Mark,
>
> Thanks for the response.
>
>  >If it takes three weeks, you will find out anyway, but why kill it after
> ten mins when it would
> have finished successfully in 19.45 minutes.
>
> I hear you!
>
> BTW how do you kill an executing stored procedure?
>
> John W. Colby
> www.ColbyConsulting.com
>
>
> Mark Breen wrote:
> > Hello John,
> >
> > I have struggled with this value, and mixed it up with the
> connectionTimeout
> > also.  As a result, when I think there will be a delay, I also set it to
> > zero, and then I sleep easy.  I did that two years ago with
> > out troublesome app, and now it works and works and works.  Whats the
> > downside of infinite timeout.  If it takes three weeks, you will find out
> > anyway, but why kill it after ten mins when it would have finished
> > successfully in 19.45 minutes.
> >
> >
> > Mark
> >
> >
> >
> >
> > 2009/11/30 jwcolby <jwcolby at colbyconsulting.com>
> >
> >> Any words of wisdom on setting the command.Timeout property?  I have
> stored
> >> procedures that execute
> >> instantly, and others that can take an hour or more (large appends).
> >>
> >> How can I discover how long a stored procedure takes to run so that I
> can
> >> set this property
> >> dynamically?  As an example I have cases where I am appending 65 million
> >> rows into a table of 6
> >> fields.  This can take a long time (at the very least perhaps 20
> minutes)
> >> but if I could get a
> >> "RecordsAffected" count for such queries as well as the time it took to
> >> execute, then I could start
> >> to discover that it takes "X seconds / million" records, and set the
> >> timeout to a reasonable value
> >> based on the records to be appended.
> >>
> >> This doesn't have to be any exact time value.  I assume a simple pair of
> >> time variables, then "stop
> >> time - start time"?
> >>
> >> Or should I just discover worst case and set it to that?
> >> --
> >> John W. Colby
> >> www.ColbyConsulting.com
> >> _______________________________________________
> >> dba-VB mailing list
> >> dba-VB at databaseadvisors.com
> >> http://databaseadvisors.com/mailman/listinfo/dba-vb
> >> http://www.databaseadvisors.com
> >>
> >>
> > _______________________________________________
> > dba-VB mailing list
> > dba-VB at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/dba-vb
> > http://www.databaseadvisors.com
> >
> >
> _______________________________________________
> dba-VB mailing list
> dba-VB at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vb
> http://www.databaseadvisors.com
>
>



More information about the dba-VB mailing list