user3129868
user3129868

Reputation: 31

Command time out Error in Delphi ADO

I am executing a storedprocedure in Oracle With ADOStoredProcedure in Delphi 2010. The procedure execution time is 2 minutes.I set Command timeout to 20 Seconds.

When I am Executing the procedure ,Error is not raising related to timeout & procedure is executing for 2 minutes. How to get error at 20th Second

I used Connection string

'Provider=MSDAORA.1;Password=pthmu;User ID=pthmu;Data Source=orcl_300'

Upvotes: 0

Views: 1234

Answers (1)

Sir Rufo
Sir Rufo

Reputation: 19106

The behaviour of ADO.CommandTimeout is depending on provider and data source as stated in the documentation

Use the CommandTimeout property on a Connection object or Command object to allow the cancellation of an Execute method call, due to delays from network traffic or heavy server use. If the interval set in the CommandTimeout property elapses before the command completes execution, an error occurs and ADO cancels the command. If you set the property to zero, ADO will wait indefinitely until the execution is complete. Make sure the provider and data source to which you are writing code support the CommandTimeout functionality.

UPDATE

Connection Timeout and Query Timeout Not Supported with Microsoft Oracle ODBC Driver and OLE DB Provider

After the query has been sent to the Oracle server, there is no way to cancel the query by using the Oracle OCI. In the case of the preceding connection timeout, you are canceling the request for the connection before it has been completed.

Upvotes: 2

Related Questions