Subject RE: [IBO] CommitRetaining
Author Jason Wharton
InTransaction is set to true when StartTransaction is called and that is
returned to false if you call Commit or CommitRetaining. If you want to
commit your work on the server but not end your explicit transaction then
use the SavePoint method instead of the CommitRetaining.

Exactly the same thing happens on the server but the difference is in how
IBO behaves.

Jason Wharton
www.ibobjects.com


> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]On
> Behalf Of Josh Higgs
> Sent: Tuesday, June 21, 2005 7:35 PM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] CommitRetaining
>
>
> Good morning all
>
> IBObjects Sub-Release: 4.2 Ib
> Interbase: 6.0.1.6
> Delphi: 5
>
> Can anyone please explain why this happens:
>
> From the first time I call CommitRetaining, all subsequents calls to
> IB_Transaction.inTransaction result in false? This means
> that the final
> "subset" of updates never gets committed when using the
> following construct:
>
> (Excuse missing sourcecode, this gets the point accross)
>
> txn.StartTransaction;
> try
> try
>
> with qry do
> begin
> close;
> {Set Parameters here}
> open;
> try
> while not eof do
> begin
> inc(lCurrentRecord);
>
> DoProcessThisRecord....
>
> if (lCurrentRecord mod 10 = 0) then
> txn.CommitRetaining; {<-- If
> this executes ...}
>
> next;
> end;
> finally
> close;
> end
> end
>
> except
> if txn.intransaction then
> txn.rollback;
> raise;
> end;
> finally
> if txn.intransaction then
> txn.commit; {<-- ... This line never
> executes}
> end;
>
> TIA
>
>
>
> Josh
>
>
>
> ______________________________________________________________
> _____________
> IB Objects - direct, complete, custom connectivity to
> Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ______________________________________________________________
> _____________
> http://www.ibobjects.com - your IBO community resource for
> Tech Info papers,
> keyword-searchable FAQ, community code contributions and more
> !
> Yahoo! Groups Links
>
>
>
>
>
>
>