PC Review


Reply
Thread Tools Rate Thread

cancelling GetDataSet()

 
 
Bob
Guest
Posts: n/a
 
      20th Oct 2004
I want to be able to cancel queries that take too long in a winforms app,
yet it's not clear to me how to do this cleanly. I want to do it in a way
that the server immediately stops execution, and not just free the client
up. Can anyone provide me with an example of the "right" way to do this?

TIA,
Bob


 
Reply With Quote
 
 
 
 
=?Utf-8?B?QWxiZXJ0?=
Guest
Posts: n/a
 
      21st Oct 2004
hi,

if you are using MS SQL .. there is this system stored procedure "SET

"Bob" wrote:

> I want to be able to cancel queries that take too long in a winforms app,
> yet it's not clear to me how to do this cleanly. I want to do it in a way
> that the server immediately stops execution, and not just free the client
> up. Can anyone provide me with an example of the "right" way to do this?
>
> TIA,
> Bob
>
>
>

 
Reply With Quote
 
=?Utf-8?B?QWxiZXJ0?=
Guest
Posts: n/a
 
      21st Oct 2004
hi,

If you are using MS SQL .. then there is this system stored procedure
"sp_Configure" where you can set the SET QUERY_GOVERNOR_COST_LIMIT statement
to specify x number of second that the long query will run ..SQL server uses
your hardware configuration capability and based on estimate to decide if
your query will exceed the setting and hence don't even attempt to run your
query if it determine it is too long running...this setting can also be set
by connection only ...
I think this is "cleanest" way ... no major coding needed .. just put your
GetDataSet() in the try catch loop to confirm the return..

Albert




"Bob" wrote:

> I want to be able to cancel queries that take too long in a winforms app,
> yet it's not clear to me how to do this cleanly. I want to do it in a way
> that the server immediately stops execution, and not just free the client
> up. Can anyone provide me with an example of the "right" way to do this?
>
> TIA,
> Bob
>
>
>

 
Reply With Quote
 
Bob
Guest
Posts: n/a
 
      21st Oct 2004
Not acceptable. There are plenty of legitimate queries that need to be
allowed to run a while, and other, shorter ones that an end user may want to
cancel. Unfortunately I think the solution will require some 'major', or at
least multithreaded coding, with which I'm not very experienced.

I suppose I could do some empirical tests to see if server load drops away
immediately on killing a thread running the query, but it doesn't give me a
warm fuzzy to take a shot in the dark doing something like that, I
definitely want to be pointed to a 'best practice' from someone who knows
more than me - both on the treading side and what happens server-side.

Bob

"Albert" <(E-Mail Removed)> wrote in message
news:630B054F-F3B0-4E96-9A9B-(E-Mail Removed)...
> hi,
>
> If you are using MS SQL .. then there is this system stored procedure
> "sp_Configure" where you can set the SET QUERY_GOVERNOR_COST_LIMIT

statement
> to specify x number of second that the long query will run ..SQL server

uses
> your hardware configuration capability and based on estimate to decide if
> your query will exceed the setting and hence don't even attempt to run

your
> query if it determine it is too long running...this setting can also be

set
> by connection only ...
> I think this is "cleanest" way ... no major coding needed .. just put your
> GetDataSet() in the try catch loop to confirm the return..
>
> Albert



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cancelling record John Microsoft Access 1 26th Nov 2006 05:16 PM
Cancelling record John Microsoft Access Forms 1 26th Nov 2006 05:16 PM
Cancelling entries =?Utf-8?B?QW1lcnk=?= Microsoft Access Form Coding 2 15th Aug 2006 06:25 PM
Cancelling fax job Jason Wicks Microsoft Windows 2000 Fax 1 24th Feb 2004 04:04 PM
Cancelling Net Use Glenn Schiller Microsoft Windows 2000 Printing 0 25th Sep 2003 08:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:49 AM.