Subject Re: Connection forcibly closed by remote host
Author Adam
--- In firebird-support@yahoogroups.com, "paultugwell" <pault@...> wrote:
>
> I have an Delphi 7 application that runs fine on the LAN and over a
> VPN at a number of sites. However, at one site the application runs
> fine over the LAN, but a PC that connects to it over the VPN is
> causing me problems. The application connects OK, which involves some
> data being read from and written to a database, but when the user
> attempts to read further data to one of the forms in the application,
> I get the 'connection forcibly closed by remote host' error message.
> If I look in the FB log file there are no entries relating to errors.
> The customer shut down his server over christmas and the only entry in
> the log file since then is the one relating to restarting FB. There
> are also no error messages in the event log on the server.
>
> My question is, is the 'host' referred to Firebird or the server on
> which it is running? Excuse my ignorance, but I need to clear this up.
> Reading the posts here and on other sites relating to this error I
> gather this is a rather intractable problem. This VPN connection has
> always been a bit dodgy, due we think to a combination of a poor ADSL
> connection and a router not really suited to use with a VPN but in the
> past has worked, albeit slowly. The problem started when the routers
> at either end of the VPN was changed for better quality equipment.
>
> Using FB 1.53 on Windows 2000 server.
>

Are these 'better quality' routers doing 'clever' things like
automatic disconnect if no traffic etc? Firebird does not use a
heartbeat, so it is conceivable that these routers think the
connection is dead if no traffic for a while. Maybe try a simple
heartbeat query (in like a TTimer every 5 minutes); 'select 1 from
RDB$DATABASE' would be a nice simple one. Actually, just establishing
a connection should be enough traffic.

Check the obvious things in Firebird.log - Firebird server did not
crash etc.

But what you have (and I don't mean to be rude) is a bit of a design
limitation. Client-server doesn't work well over an unreliable
connection, and WANs always have and always will be unreliable. One of
two things may happen. Either you tell the customer that your
application requires a reliable network connection and they will get
these sorts of errors if it ever becomes unreliable, or you need to
design your application to expect this sort of thing to happen, using
something like a RemObjects service on the server and having your
client connect to that service (which in turn makes a connection,
performs whatever task then closes the connection or returns it to a
pool or something).

Hope that helps

Adam