Subject RE: [IBO] Connection lost question
Author IBO Support List
Dany,

You might want to try this modification to see how things go:

procedure TIB_Transaction.API_Start;
...
while ( errcode = isc_conn_lost ) and ( ticks > GetTickCount ) do
errcode := isc_start_multiple( @status,
PtrHandle,
ConnectionCount,
pteb );
if errcode <> 0 then
begin
CheckLostConnection; // Added in this line of code.
HandleException( Self );
end;
...

Jason


-----Original Message-----
From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] On Behalf
Of DanyM
Sent: 18 January 2012 07:22 AM
To: IBObjects@yahoogroups.com
Subject: [IBO] Connection lost question

Hello!

I have an error handler for the query and for the transaction. In this
handler I do

if ConnectionLostErrcode( ERRCODE ) then begin
ConnectionDataModule.ConnectionLost;
RaiseException := false;
Abort;
end;

the ConnectionDataModule then calls an event handler in the GUI part that
sends a windows message to the main form. The main form throws up a
messagebox asking if we should try to reconnect.

My problem is that in the cases where the TIB_Transaction raised the
exception there will often be another lost connection exception immediately
after. At least when the first one came from an API_Start there will be
another one from a following call to API_Committ.

How do I determine that I already handled one lost connection exception and
that the following ones are just the following ones?

TIA,

/Dany