Subject | Re: [IBO] REPOST: exception handling suggestion |
---|---|
Author | Markus Ostenried |
Post date | 2007-01-29T18:50:33Z |
On 1/29/07, d_dude_2003 <d_dude_2003@...> wrote:
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
> Is there a way to get to IB_Connection.OnError event handler in caseMaybe you can try something like this:
> of network failure, despite of this try..except block?
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