|Subject||Re: [IBO] How to reconnect to DB II|
> Yes, there are various errcodes that indicate a lost connection.Hello Jason,
> I can't specifically remember but I have them in a ConnectionWasLost list.
> Please snoop the sources and let me know if you can't find it. I'd find it
> now but I'm hoppin busy.
I found the following function in IB_Session.pas:
function ConnectionLostErrcode( const AErrCode: integer ): boolean;
Result := ( AErrCode = isc_shutdown ) or
( AErrCode = isc_lost_db_connection ) or
( AErrCode = isc_network_error ) or
( AErrCode = isc_net_connect_err ) or
( AErrCode = isc_net_connect_listen_err ) or
( AErrCode = isc_net_event_connect_err ) or
( AErrCode = isc_net_event_listen_err ) or
( AErrCode = isc_net_read_err ) or
( AErrCode = isc_net_write_err );
Shall I use the result of this function to know whether or not I must call
to make an attempt to reconnect to database? Or just take some subset of
those codes (like calling only Disconnect on isc_shutdown or so)?
Seems my problem might be solved soon. :-)
(P.S. for those who also search for how to solve this, the codes mentioned
above are defined in IB_Header.pas)
> ----- Original Message -----
> From: "Andreas Bednarek" <bluehorse@...>
> To: <IBObjects@yahoogroups.com>
> Sent: Friday, January 23, 2004 2:27 AM
> Subject: Re: [IBO] How to reconnect to DB II
> > > >
> > > > if ERRCODE = 335544721 then begin
> > > > Disconnect;
> > > > Connect;
> > > > end;
> > > >
> > >
> > > Do NOT make any calls in the OnError event like Disconnect or Connect.
> > > That is the wrong place to react to an error.
> > > You should only set flags and most of the time raise an exception or
> > > the default exception to be raised.
> > >
> > > Jason Wharton
> > > www.ibobjects.com
> > Thanks for the tip Jason, good to know that. Do I have to track another
> > ERRCODE values than the mentioned 335544721, too? I mean for the case
> > connection was lost and I should try to reconnect?___________________________________________________________________________
> > Thanks
> > Andreas
> IB Objects - direct, complete, custom connectivity to Firebird orInterBase
> without the need for BDE, ODBC or any other layer.___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Infopapers,
> keyword-searchable FAQ, community code contributions and more !
> Yahoo! Groups Links
> To visit your group on the web, go to:
> To unsubscribe from this group, send an email to:
> Your use of Yahoo! Groups is subject to: