[cx-oracle-users] Terminating an execute_many()
Brought to you by:
atuining
From: Jeff W. <jef...@sa...> - 2004-01-30 22:00:35
|
Hi, Let's say I'm running an execute_many() on an SQL statement and at some point I decide it's taking to long. What is the best or cleanest way to terminate this execution? Here's some further background info: I have 2 threads: one which does database insertions, and another which monitors that thread. From the monitoring thread, I want to arbitrarily raise an exception such that the inserting thread stops what it's doing. The insertion thread does the "insertions" is the MainThread. I've tried: 1) Sending a SIGTERM to the MainThread, catching it in a handler that I have installed, and doing sys.exit() from the handler. 2) Calling sys.exit() from the monitoring thread when the insertion thread is busy doing the execute many. 3) Sending a SIGINT to the MainThread. None of these terminate the transaction execute_many() right away. Is there any way to do this on cx_Oracle 3.0? I noticed that Connection objects in 4.0 have cancel() function. Is this what I want? TIA, Jeff |