Hello
I need a way to find out that a PgDac connection is/was down. Unfortunately, what I am currently experiencing this is that after short network connection loss, the next query raises an exception (Socket error on read / Socket error on write) and in case of protocoll pv20, all further queries raise an exception.
I don't see the OnConnectionLost working and my alerters are not re-registered after a reconnect even with AutoRegister.
I have basically no way of finding out that a reconnect happened. I need to be notified about this event and re-register events and call some application-specific initialization queries.
How do I build a bullet-proof application with PgDac?
Fail safe connection
You can use the AfterConnect event of TPgConnection to execute your initialization queries. The AutoRegister property of TPgAlerter does not support the automatic reconnect of PgDAC. You should start alerters manually in the AfterConnect event.
The OnConnectionLost event can be fired only if you set the LocalFailover option of TPgConnection to True. In this case the reconnect is smarter, and can be performed without rasing an exception to the user.
See the 'Using PgDAC / Working in an Unstable Network' topic in the PgDAC help for more information about the LocalFailover feature.
The OnConnectionLost event can be fired only if you set the LocalFailover option of TPgConnection to True. In this case the reconnect is smarter, and can be performed without rasing an exception to the user.
See the 'Using PgDAC / Working in an Unstable Network' topic in the PgDAC help for more information about the LocalFailover feature.