Detecting connection loss? Doesn't work
Posted: Tue 16 Sep 2008 16:38
Hi!
My client app is running in a stable network. It's connected to the server either through LAN or the Internet - using TCP based connection.
There could be two causes of connection loss:
1, The user hybernates his/her computer (then relaunches it)
2, The user forces a disconnection from the network through windows (by disabling WLAN, unplugging network cable etc.)
In both cases, I'd like to detect the connection loss in my app, and prompt the user to reconnect with a dialog.
The problem:
As I understand, in order to use the OnConnectionLost event, you have to set LocalFailover to true, include MemData in uses list and set Transactions to ReadOnlyReadCommitted.
But all my transactions are readcommitted (not readonlyreadcommitted) and I can't change that!
This way, even if I set LocalFailover to true, the OnConnectionLost event doesn't occur!
How does IBDAC keep the connection to the server? Does it ping the server automatically? Is there a variable to specify pinging interval?
Is there a way to promptly detect connection loss when the computer is disconnected from the network?
Right now no event is generated, but when a query is launched (after being disconnected), there are a bunch of "Error writing data to connection" dialogs and "Unknown isc error 0" dialogs are popping up while Access Violations keep happening!
Thanks:
Zd
My client app is running in a stable network. It's connected to the server either through LAN or the Internet - using TCP based connection.
There could be two causes of connection loss:
1, The user hybernates his/her computer (then relaunches it)
2, The user forces a disconnection from the network through windows (by disabling WLAN, unplugging network cable etc.)
In both cases, I'd like to detect the connection loss in my app, and prompt the user to reconnect with a dialog.
The problem:
As I understand, in order to use the OnConnectionLost event, you have to set LocalFailover to true, include MemData in uses list and set Transactions to ReadOnlyReadCommitted.
But all my transactions are readcommitted (not readonlyreadcommitted) and I can't change that!
This way, even if I set LocalFailover to true, the OnConnectionLost event doesn't occur!
How does IBDAC keep the connection to the server? Does it ping the server automatically? Is there a variable to specify pinging interval?
Is there a way to promptly detect connection loss when the computer is disconnected from the network?
Right now no event is generated, but when a query is launched (after being disconnected), there are a bunch of "Error writing data to connection" dialogs and "Unknown isc error 0" dialogs are popping up while Access Violations keep happening!
Thanks:
Zd