Page 1 of 1

IBCAlerter in a Service Application

Posted: Fri 02 Oct 2009 14:13
by l_vaskov
Hello,

Has anyone tried to use a TIBCAlerter in a service application? It works in a regular application, but not in a service application. As far as I can see in the source code the callback function "EventCallback" is not called, when an event is fired in the database.

Thats how I setup the component:

In the service there are some worker threads, each of them has its own TIBCConnection and TIBCAlerter. In the beginning of the Execute method of each thread is the following:

myConnection.Connect;
myAlerter.Connection:= myConnection;
myAlerter.OnEvent:= myAlerter.myAlerterEvent;
myAlerter.Stop;
myAlerter.Events.Text:= 'Sync';
myAlerter.Start;

Is this the right way? I've done this in a regular application and it works.
In the service application I can see that the callback function EventCallback is called once at the start of each thread, but when an event is posted from the database, this callback function is not called and the OnEvent is not fired.

Thank you

Posted: Mon 05 Oct 2009 09:04
by Plash
This is a bug of InterBase/Firebird client. You should start alerter from the main thread to make it work.

Posted: Mon 05 Oct 2009 13:51
by l_vaskov
I managed to get it working using IBX. It's TIBEvents component works well when in another thread.

I almost convinced my boss to buy licences for the entire team so we can use your components in more projects, but this problem is bad. If you can get it working, it would be very nice.

Thanks

Posted: Tue 06 Oct 2009 07:22
by Plash
We have fixed this problem. The fix will be included in the next build of IBDAC.

Posted: Tue 06 Oct 2009 10:58
by l_vaskov
Great, thanks for the fast response :)