Subject | Restoring a lost connection? |
---|---|
Author | micarnal |
Post date | 2003-03-28T00:32:44Z |
Hi, Jason a number of users have been asking how to handle this
situation safely. Would it be possible to get an example of your
usual responses:
My current code is:
procedure TDaDataMod.IB_ConnectionError(Sender: TObject;
const ERRCODE: Integer; ErrorMessage, ErrorCodes: TStringList;
const SQLCODE: Integer; SQLMessage, SQL: TStringList;
var RaiseException: Boolean);
begin
if not IB_Connection.VerifyConnection then
begin
DebugLog('Database Connection is lost.');
IB_Connection.ForceDisconnect;
if timmerDatabaseConnect.Enabled = False then
begin
IB_Connection.RequestReconnect;
timmerDatabaseConnect.Enabled := True;
end;
RaiseException := False;
end;
end;
=========================
BTW the Database reconnect timmer just calls:
IB_Connection.RequestReconnect;
From what I read you said I should do this, could you provide an
example of how this should be done. Please...
Thanks
situation safely. Would it be possible to get an example of your
usual responses:
My current code is:
procedure TDaDataMod.IB_ConnectionError(Sender: TObject;
const ERRCODE: Integer; ErrorMessage, ErrorCodes: TStringList;
const SQLCODE: Integer; SQLMessage, SQL: TStringList;
var RaiseException: Boolean);
begin
if not IB_Connection.VerifyConnection then
begin
DebugLog('Database Connection is lost.');
IB_Connection.ForceDisconnect;
if timmerDatabaseConnect.Enabled = False then
begin
IB_Connection.RequestReconnect;
timmerDatabaseConnect.Enabled := True;
end;
RaiseException := False;
end;
end;
=========================
BTW the Database reconnect timmer just calls:
IB_Connection.RequestReconnect;
From what I read you said I should do this, could you provide an
example of how this should be done. Please...
Thanks