Lock/deadlock and threads
Posted: Thu 04 Oct 2007 13:18
Hello,
I'm using Borland Delphi 2006 and ODAC 6.20 (I tried ODAC 5.80).
I created Threads to run SQL commands, because the application needs to dialog with the second database even if the first wait the answer from the database.
I use ExecSQL procedure from TCustomOraQuery to execute the queries.
It's works, but when the database is in Lock/deadlock mode, the ExecSQL wait.
If there are a unlock, the command is executed and the thread normaly terminated.
If there are a network problem, the thread still run infinitly.
If I kill the Thread like "TerminateThread(ThreadOracle.Handle, 0);", The thread is terminated but when I recreate the Thread (after the unlock of the database) the ExecSQL still waiting...
Perhaps there are a link not terminated with the ODAC.
What's the solution to terminate the Thread properly or detect and stop ExecSQL ?
Thank you in advance,
Gaby
I'm using Borland Delphi 2006 and ODAC 6.20 (I tried ODAC 5.80).
I created Threads to run SQL commands, because the application needs to dialog with the second database even if the first wait the answer from the database.
I use ExecSQL procedure from TCustomOraQuery to execute the queries.
It's works, but when the database is in Lock/deadlock mode, the ExecSQL wait.
If there are a unlock, the command is executed and the thread normaly terminated.
If there are a network problem, the thread still run infinitly.
If I kill the Thread like "TerminateThread(ThreadOracle.Handle, 0);", The thread is terminated but when I recreate the Thread (after the unlock of the database) the ExecSQL still waiting...
Perhaps there are a link not terminated with the ODAC.
What's the solution to terminate the Thread properly or detect and stop ExecSQL ?
Thank you in advance,
Gaby