We've bought dbx driver for Firebird and recently faced up problem with detecting lost connection. I realized that property Connected of TSQLConnection remains True although firebird was unexpectedly shut down.
How to detect the lost connection? Is it possible only while executing a statement by catching an exception?
Detect lost database connection
Re: Detect lost database connection
When a database server shuts down, clients that are connected to it know nothing about it. That's why, to detect a connection loss, the only way is to try to perform any operation on a server. In case of error, an exception is generated which you should catch.
Please note that if a connection error occurs, dbExpress driver for InterBase and Firebird tries to reconnect (it is controlled by the Reconnect connection option). If it is possible, connection is established again.
Please note that if a connection error occurs, dbExpress driver for InterBase and Firebird tries to reconnect (it is controlled by the Reconnect connection option). If it is possible, connection is established again.