Minor threading flaw in TOraAlerter
Posted: Mon 04 Aug 2008 01:05
I am running ODAC professional version 6.50.0.35 against Delphi 7 build 4.453.
I created a test application which exposes a minor threading flaw in TOraAlerter. Actually, there are two applications. One sends an alert using TOraAlerter. The other receives the alert, also using TOraAlerter.
I will attach the application to this topic once I figure out how (I am new to this forum.)
I use the etAlert (DBMS_ALERT) type, not the pipe.
The basic problem occurs in the TOraAlerter OnEvent event. I use ShowMessage procedure within the event, to display a message with the time so that I can tell how long it took to post and then receive the message.
While the ShowMessage dialog is opened, I noticed that one CPU (I have a four-CPU system) was fully occupied. (Peformance monitor went to 25%, and stayed there.)
As soon as I close the ShowMessage dialog box, then CPU goes back down to 0%. This was intriguing, because it should not happen.
Anyway, see the test application to verify.
I also include a work-around in the test application. By using PostMessage to a call-back function, within the OnEvent event, the ShowMessage box can come up, and CPU stays at 0%.
I created a test application which exposes a minor threading flaw in TOraAlerter. Actually, there are two applications. One sends an alert using TOraAlerter. The other receives the alert, also using TOraAlerter.
I will attach the application to this topic once I figure out how (I am new to this forum.)
I use the etAlert (DBMS_ALERT) type, not the pipe.
The basic problem occurs in the TOraAlerter OnEvent event. I use ShowMessage procedure within the event, to display a message with the time so that I can tell how long it took to post and then receive the message.
While the ShowMessage dialog is opened, I noticed that one CPU (I have a four-CPU system) was fully occupied. (Peformance monitor went to 25%, and stayed there.)
As soon as I close the ShowMessage dialog box, then CPU goes back down to 0%. This was intriguing, because it should not happen.
Anyway, see the test application to verify.
I also include a work-around in the test application. By using PostMessage to a call-back function, within the OnEvent event, the ShowMessage box can come up, and CPU stays at 0%.