Subject RE: [IBO] Transactions
Author Alan McDonald
> Hi
>
> I use IBO.
>
> I manually start every transaction by doing this:
>
> if (not (DMEksp.trEksp.InTransAction)) then
> DMEksp.trEksp.StartTransAction;
>
>
> Do a little or a lot.
>
>
> if ((DMEksp.trEksp.InTransaction)) then
> DMEksp.trEksp.Commit;
>
>
> Isn't that the right way to handle transactions ?
>
>
> Michael

I don't always manually start a transaction. Opening a query will start it's
transaction. I often test is a transaction is started before I open a query
or execute a cursor, if it's already started I try to commit and start it
again.
I've posted elsewhere here about the subtleties of the different methods of
testing if a transaction is current. If you are religious about manually
starting them, then you may rely on one method of testing. If you are not
religious about manual starts (and use implicit transaction starts.....

you start a transaction implicitly by opening a dataset. You start it
explicitly by first starting it then opening the dataset.

the problem I have now solved has everything to do with this disparate way
IBO handles these two kinds of transaction starts and which boolean test you
use of the three:
IB_Transaction1.TransactionIsActive
IB_Transaction1.Started, or
IB_Transaction1.InTransaction
in order to test and refresh this implicit or explicit transaction.

The timeout props behave quite differently with an implicit transaction
start as opposed to an explicit start.

Alan