We have a Delphi7 + UIB + Firebird 2.5 application for pizzerias, working rock stable on wired networks.
But on wifi, (working with Win8/Win10 TabletPCs,) if the connection is broken, UIBDatabase can not reconnect itself automatically.
(We are currently reconstructing the whole APP to remove "IBX leftovers", but after upgrading UIB to the latest version, problems seems to be even worse!)
After a tipical connection loss, an error msg. is:
Project ...exe raised exception class EUIBError with message 'connection rejected by remote interface
Connection not established
GDS Code: 335544421 - SQL Code: -923 - Error Code: 101'. Process stopped.
Even if I try to close the current connection with .IsConnected:=False
or .CancelAbort
It can not reconnect again any more:
Project ...exe raised exception class EUIBError with message 'invalid statement handle
Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements
GDS Code: 335544485 - SQL Code: -901 - Error Code: 165'. Process stopped. Use Step or Run to continue.
So whatever we do, we can not reconnect!
The worst case is when the TabletPC goes into sleep mode, because the connection is definitely broken, but the component thinks it's still online. It takes minimum of 8 seconds for it to realize the query can not be executed.
We've tried to start a TTimer before to force cancel the operation after 2000ms, but that event never gets fired.
So I wonder:
- Is there a way to handle these cases properly?
- Nobody else has problems like this? (Red every related topic here, found only 1 similar with 0 solution.)
- Is the current UIB component downloadable from here not stable? (Had' hard time to compile under D7 because of many SynEdit incompatibility errors!)
- Why is
.OnConnectionLoss
event fired only after I'm trying to reconnect again? - Is it possible to reconnect to the:
SAME transaction again,
finish the query
and Commit & close properly?
(Since we can read the transaction ID from Firebird.) ... so the server won't need to hold it open for 2+ hours.