Subject Re: [firebird-support] XP standby mode: SQL connection was lost
Author Helen Borrie
At 04:53 PM 9/08/2006, you wrote:
>Not exactly a IBO question, but maybe IBO has some options or this mailing
>list has some ideas or experiences:
>My application is giving "-902 SQL:connection was lost" error after a longer
>WinXP standby time.
>Fehler bei der Verbindung zur Hauptdatenbank fbsql:/firebird/wvo.fdb
>Errormessage:ISC Fehlernummer:335544721
>ISC Fehlermeldung:
>Unable to complete network request to host "fbsql".
>Error reading data from the connection.
>Eine vorhandene Verbindung wurde vom Remotehost geschlossen.
>Trying to reproduce that this morning with a short 5min. standby time does
>NOT show this error.
>I assume it correlates to the firebird.conf parameter "connectiontimeout"
>defaulted to 180minutes.

No, it doesn't. That parameter determines how long the server will
wait until it concludes that a client's attempt to connect has
failed. And the default is 180 seconds.

>So I think it will show up after >180min. standby phase.

It's likely to show up after the network operating system has decided
that the client has gone idle and destroys the socket. On Windows,
this period defaults to 4 hours. On Windows, you can't set this up
with any utility. You have to visit the MSDN website (via Google is
recommended) and discover a key that you have to insert into the
Registry manually. On Linux, it's a question of modifiying a config file.

Once the socket is destroyed, the server detects the dead connection
and proceeds to flag all of its transactions for rollback and garbage

>Well, for my customers that's kind of annoying on their daily work.
>Any idea to avoid this problem?

Don't let machines go into standby unless you have some way to tell
the network operating system that the machine is only playing
dead. Seriously discourage your users from abandoning their tasks
unfinished to go to lunch.

>Is there a way to auto-reconnect safely?

The server has no way to predict what users or applications are going
to do. It doesn't have any way to know how the NOS has been
configured, either. Some programming interfaces provide ways to
protect applications from neglectful users and give the user the
*impression* that he is carrying on where he left off before
lunch. If you're not using an interface layer that has such
capabilities, then your users are at the mercy of your network and
its administrator.