Subject Re: [IBO] REPOST: exception handling suggestion
Author Markus Ostenried
On 1/29/07, d_dude_2003 <d_dude_2003@...> wrote:
> Is there a way to get to IB_Connection.OnError event handler in case
> of network failure, despite of this try..except block?

Maybe you can try something like this:

uses IB_Session; // declares EIB_ISCError, ConnectionLostErrcode

StoredProcedure.SQL.Clear;
StoredProcedure.StoredProcName := 'MY_SP';
.....
TheTransaction.StartTransaction;
try
StoredProcedure.ExecProc;
TheTransaction.Commit;
except
on E: Exception do begin
TheTransaction.Rollback;
if (E is EIB_ISCError) then begin
if ConnectionLostErrcode(EIB_ISCError(E).ERRCODE) then
raise;
end;
end;
end;

HTH,
Markus