Simultanious queries execution

Yoggi

Member
Hi!

The question is as follows:

I have two costy update SQLs, which I want to execute simultaniously, is it possible?

To explain better, assume, that the following code will work:

ExecuteInBackground('Update ...');
ExecuteInBackground('Delete ...');
ExecuteInBackground('Insert ...');
ExecuteInBackground('Update ...');
WaitForBackgroundQueries;

Where ExecuteInBackground, executes some statement in background, on some server (load balancing will choose one), and WaitForBackgroundQueries will wait for the completion of all the background queries and raise any exceptions in case of errors (please note, not really background, as I need notification of completion).

Thanks for any assistance!!!
 
You can only execute statements simultaneously if they are using different sessions. The easiest way to execute something in the background is through a TOracleQuery. By setting the Threaded property to True, execution will be performed in a background thread, and you can use the OnThreadFinished event to signal to the main thread that the work is done. Each TOracleQuery must have its own session though, otherwise database access will be serialized.

------------------
Marco Kalter
Allround Automations
 
Back
Top