Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for PostgreSQL in Delphi and C++Builder
Post Reply
Posts: 4
Joined: Tue 29 Jan 2013 10:41


Post by lepr8 » Wed 13 Apr 2016 09:05

There is the ability to know when there was a reconnection to the DB?
During connection set of session-level parameters that naturally are lost if there was a reconnection.



Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Reconnect

Post by azyk » Fri 15 Apr 2016 09:00

dbExpress technology doesn't allow driver to inform TSQLConnection about connection loss. Therefore, in dbExpress, it is impossible to detect reconnection.

The feature that allows to control connection loss cases is present in another our product PgDAC - LocalFailover.

You can know about connection loss using the TPgConnection.OnConnectionLost event handler. Note, that the TPgConnection.OnConnectionLost event doesn't occur at the moment of loosing connection to PostgreSQL. This event occurs when PgDAC refers to the server, and the connection is already lost. To use OnConnectionLost, set the TPgConnection.Options.LocalFailover property to True. See more details in the documentation: ... ilover.htm

Post Reply