Problem with TOracleEvent

Uli Kobsa

Member²
Hi,

I played around with dbms_pipe to receive messages from a long running procedure. So far everything works fine. But TOracleEvent seems to receive all the messages after my stored procedure is finished.
Having looked with OracleMonitor I can see that the first message is received, when my proc starts and sends the first message. But then all the remaining messages can only be seen after the procedure is finished.

I
 
Have you set TOracleEvent.Synchronized to False? If it is True, you will only receive messages after the main thread of your application is finished executing the procedure.

You can alternatively call the procedure in a background thread.

See the TOracleEvent.Synchronozed help topic for more details.

------------------
Marco Kalter
Allround Automations
 
Hi Marco,

Synchronized was TRUE and after setting it to FALSE it works.
But one point: to show the messages from PL/SQL I cannot use something like a progress bar, because then it also shows the messages only after termination of my PL/SQL-Proc. I think, it has to do that I can only use VCL-comps in the main thread. It works better, when I draw my messages on a canvas and lock/unlock this canvas. Then I received every ten-th messages. Could this be a timing problem (there is about 2 seconds between drawing the messages)?
Or do you know a better way to give feedback to the user ?

Thanks for your help,
Uli
 
You can execute the procedure in a background thread (set TOracleQuery.Threaded to True), and set TOracleEvent.Synchronized to True. Now your application remains responsive during procedure execution, and you can do whatever you want in the OnEvent handler.

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