Firebird connection timeout
Posted on 2013-12-14
I have an application that accesses a Firebird database managed by a remote Firebird server.
If there is not activity between the application and the database for a given time (I didn't test for how long it is), then if the application starts some work with the connected firebird server, it gets : "Unable to complete network request to host "....". Error reading data from the connection. An existing connection has been closed by the host" (last phrase I translated from french)
I understand that very well but I want to fix it.
In my code, each time I start some SQL activity, I check if the Connected property of the TIBDatabase is true and if not, I set it to true.
The problem here is that the application see it as true but it is practically not as the host has stopped it !
So my question, what is the best code I can write to "reopen" the connection IF AND ONLY IF IT has been close by the host