Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Terminating threads running sql
Sun, Apr 12 2009 9:13 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Using fileserver rather than c/s does anyone have a safe way of terminating threads which are running SQL which might include INSERT/UPDATE/DELETE statements when the app is closed?

I was thinking of using the OnProgress event but that may not fire consistently enough (I could wait 100ms but not 15secs). I could just allow Windows to bomb the thread when the app is closed but I have a sneaky suspicion that at some point I'll get a nice wadge of corruption.

The type of query I'm thinking of will be:

DELETE FROM table WHERE ....

or

INSERT INTO table SELECT ... FROM table2 WHERE ....

Roy Lambert

Mon, Apr 13 2009 8:32 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< I was thinking of using the OnProgress event but that may not fire
consistently enough (I could wait 100ms but not 15secs). I could just allow
Windows to bomb the thread when the app is closed but I have a sneaky
suspicion that at some point I'll get a nice wadge of corruption. >>

The only way is to abort via the OnProgress event, and then do a WaitFor
until the thread execution completes.  There's really no other way to deal
with it.

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Apr 13 2009 9:03 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

>The only way is to abort via the OnProgress event, and then do a WaitFor
>until the thread execution completes. There's really no other way to deal
>with it.

As I suspected then. Hence my points in my other post about the number of times the on progress event fires.

To the best of my knowledge Windows will just clobber any threads I leave running at the point the app is closed. So unless you come up with a solution it looks as though my best option would be to launch a separate process. Any comments.

Roy Lambert
Image