Re: Cancelling an ADO Command takes too long
- From: "Clayton Arends" <nospam_claytonarends@xxxxxxxxxxx>
- Date: Sat, 25 Nov 2006 14:55:13 -0800
Brian,
Your original question references AdoCommand which does not return a
recordset
It does so through the use of TADOConnection::OnExecuteComplete which is
where one can assign the result set to a TADODataSet or iterate the
_Recordset on one's own. Another way (which I have not tried yet, only
looked at in research) is to use the result of TADOCommand::Execute() and
not iterate through it until its State property is adStateOpen.
If you are using TadoDataset or TadoQuery to return the select then you
would
use Adodataset1.recordset.cancel to cancel Asyncronous execution.
I'm already familiar with canceling queries that are in the process of
fetching the data (thanks for the info again, though) ;-). The problem I'm
trying to overcome is canceling queries that have not yet returned anything.
Those where the server is still crunching away on the query itself rather
than returning results. I'm sure there is a word for this state but I don't
have it in my lexicon. I guess in ADO terms that would be "executing" as
opposed to "open" or "fetching".
I did a lot more digging in Google since my last post here using some
different search criteria than before. I tracked down dozens of posts with
titles like "How to cancel ADO query in Oracle?" From what I've seen it
appears that Oracle does not support canceling a query in this manner (7
through 9i were mentioned). Apparently the Oracle way of doing things is
through another session (at least in ADO, I'm not sure if this is supported
using native drivers).
I might have to go to plan B. My actual product is a multi-tier app in
which the server is responsible for the ADO communications. I already offer
the ability for admins to close active connections against my server. One
of the only situations where this doesn't work is when an ADO query is
active. The inability for me to consistently be able to cancel an ADO query
means that I'll need to create the option for the code to orphan active ADO
connections and queries if they are in the above mentioned state. This will
allow my program to cancel the active query as far as the client is
concerned and still be able to clean up the ADO connection if the query ever
does return. This isn't my favorite solution but it does allow me a little
more freedom.
- Clayton
.
- References:
- Cancelling an ADO Command takes too long
- From: Clayton Arends
- Re: Cancelling an ADO Command takes too long
- From: Guillem
- Re: Cancelling an ADO Command takes too long
- From: Clayton Arends
- Re: Cancelling an ADO Command takes too long
- From: Brian Bushay TeamB
- Cancelling an ADO Command takes too long
- Prev by Date: Re: Refreshing a current record in a DataSet
- Next by Date: Re: Refreshing a current record in a DataSet
- Previous by thread: Re: Cancelling an ADO Command takes too long
- Next by thread: No update of DBGrid based on TADOQuery?
- Index(es):
Relevant Pages
|