IBCAlerter in a Service Application

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
l_vaskov
Posts: 6
Joined: Fri 02 Oct 2009 13:58

IBCAlerter in a Service Application

Post by l_vaskov » Fri 02 Oct 2009 14:13

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 05 Oct 2009 09:04

This is a bug of InterBase/Firebird client. You should start alerter from the main thread to make it work.

l_vaskov
Posts: 6
Joined: Fri 02 Oct 2009 13:58

Post by l_vaskov » Mon 05 Oct 2009 13:51

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 06 Oct 2009 07:22

We have fixed this problem. The fix will be included in the next build of IBDAC.

l_vaskov
Posts: 6
Joined: Fri 02 Oct 2009 13:58

Post by l_vaskov » Tue 06 Oct 2009 10:58

Great, thanks for the fast response :)

Post Reply