Postby 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.


Posts: 4
Joined: Tue 29 Jan 2013 10:41

Re: Reconnect

Postby 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:
Devart Team
Posts: 979
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Return to dbExpress driver for PostgreSQL