Clarification on BreakExecution

Did a forum search on BreakExecution and read all the posts that came up. On discussion mentioned that calling TOracleSession.BreakExecution from another thread can have unpredictable results. However in a multi-threaded, multi-session environment, a long exec of a query or stored procedure would be blocking the thread it is executing on so it would seem some second supervising thread would have to issue the BreakExecution or spawn another thread to do an ALTER SYSTEM KILL SESSION. Is this the way it should be done? If because of a lock or some other reason the BreakExecution is not reasonably responsive, will the OracleQuery normally return quickly with an 01013 or similar error if the KILL SESSION is issued? I will also check this experimentally but wanted to double check in case things work in test but may fail in the real world.
 
BreakExecution can only be called from a different thread than the one that is currently executing the SQL you want to break.

The same goes for an "alter system kill session" statement, though this additionally requires a separate session. It may be necessary to create a new TOracleSession instance, logon with a user that has the alter system privilege, execute the alter system statement for the appropriate sid and serial, and free the newly created TOracleSession instance.
 
Back
Top