Page 1 of 1

Abort long-running fetch

Posted: Thu 29 Nov 2007 08:25
by heidenbluth
There is a TOraQuery.BreakExec procedure that allows me to abort query execution while it is running on the server. Sometimes, I rather wish to cancel fetching. Lets consider a query that executes fast and displays in an instant the first rows in a data grid. Now the user presses the "Last" button, and the application starts fetching a whole bunch of rows. After waiting a couple of minutes, he would wish to cancel fetching rather then killing the entire application. Is there a way, maybe some sample code, how this can be done?

I would like to display a modal dialog in another thread with a cancel button as soon as fetching runs longer than say 3 seconds. It is essential that it works event-driven, i.e. if the user presses "Last" it should come up. The button should allow to cancel fetching. As soon as the fetching has completed the dialog should hide automatically. I have done a similar thing for executing.

Any suggestions are welcome. Maybe it is a good idea for a future ODAC enhancement.

Regards,
Holger

Posted: Thu 29 Nov 2007 09:14
by Plash
In the current ODAC version BreakExec method also stops fetching.