Subject | Re: [IBO] TIB_Connection Losing Connection. PLEASE HELP |
---|---|
Author | Heri |
Post date | 2002-11-03T20:19:34Z |
> All our query components start transactions as follows:I wonder why you enclose the commit statement within a try..finally block.
>
> if not qryXX.IB_Transaction.InTransaction then
> qryXX.IB_Transaction.StartTransaction;
> if not qryXX.IB_Transaction.Started then
> qryXX.IB_Transaction.Started := true;
> try
> try
> qryXX.Open;
> finally
> qryXX.IB_Transaction.Commit;
> end;
> except
> try
> qryXX.IB_Transaction.Rollback;
> except
> end;
> raise;
> end;
Like this, any exception which comes up after the open statement (I assume
you have some statements there), will cause first to commit (in the finally
part) then rollback (in the except part), which I believe cannot be healthy.
Heri