Subject | TIB_Events and multithreading |
---|---|
Author | |
Post date | 2015-04-27T13:53:16Z |
Hello!
I have a multithreaded server. It uses connection pooling. Actually there is a pool of pools, each with a different DataModule as base class for the pooled objects.
The server also listens to events. The listener TIB_Event is of course connected to a TIB_Connection (with it's own TIB_Session) component. When an event notification is received a new thread will be spawned where the cached data (depending on event) is updated.
If the connection(s) is(are) lost, then the pooled DataModules will eventually time out and when accessed anew will continue to work if the connection can be made again. This is quite ok as the clients will get an error.
The problem is the connection of the event component. If this connection is lost, i won't get any notifications from the database. Thus it seems i'll never get an "connection lost" error code. I tried to hook into the OnErrorEx of the event alerters connection but it will not trigger.
Any ideas for this problem. Anyone hacked around it and in that case how did you do it? The thing is that an event could be important even though the server does not need to access the database any other way for some time. This leaves me with a server that thinks it has the correct (up to date) info but has not. It will not get notified even.
A regular check on the connection being alive comes to mind. Is this safe to do?
Vague questionings, i know. Sorry about that.
BTW - FB 2.5.x, IBO 5.7.3 2238, XE7
TIA,
/Dany