Subject | Re: Unable to complete network request to host 335544721 |
---|---|
Author | rjschappe |
Post date | 2006-05-20T14:16:02Z |
Helen, thanks a bunch!!!
This looks almost too easy... so I am thinking I am not doing it
correctly...
Here is my IBODatabase.OnError routine... does this look correct or am
I forgetting something? I have tested this by yanking out my LAN cable
and it worked... but that is not exactly the most "scientific" method! :-)
procedure TdmRolodex.dbRolodex2Error(Sender: TObject;
const ERRCODE: Integer; ErrorMessage, ErrorCodes: TStringList;
const SQLCODE: Integer; SQLMessage, SQL: TStringList;
var RaiseException: Boolean);
begin
if (ERRCODE=isc_network_error) then
begin
if (not dbRolodex2.VerifyConnection) then
begin
dbRolodex2.ForceDisconnect;
dbRolodex2.Connect;
end;
end;
end;
Many thanks,
-Raymond
This looks almost too easy... so I am thinking I am not doing it
correctly...
Here is my IBODatabase.OnError routine... does this look correct or am
I forgetting something? I have tested this by yanking out my LAN cable
and it worked... but that is not exactly the most "scientific" method! :-)
procedure TdmRolodex.dbRolodex2Error(Sender: TObject;
const ERRCODE: Integer; ErrorMessage, ErrorCodes: TStringList;
const SQLCODE: Integer; SQLMessage, SQL: TStringList;
var RaiseException: Boolean);
begin
if (ERRCODE=isc_network_error) then
begin
if (not dbRolodex2.VerifyConnection) then
begin
dbRolodex2.ForceDisconnect;
dbRolodex2.Connect;
end;
end;
end;
Many thanks,
-Raymond
> You can make it so. The connection itself has no way to know that
> the connection was broken until a request fails, so you need to
> provide a handler for this exception (its symbolic name is
> isc_network_error). You can call VerifyConnection, which returns
> False if there really is a broken connection and will set the
> ConnectionWasLost flag too. Once you have established that the
> connection is broken, you can call ForceDisconnect to clean up around
> the dead connection; and then call some retry code of your own to
> make a new connection.
>
> Helen
>