Subject Re: [IBO] gds32 Access Violation
Author Helen Borrie
At 01:30 PM 09-05-01 +0200, you wrote:
>Helen wrote:
> >Is it possible that you are trying to commit (or rollback) an unhandled
> >transaction?
> >If you use explicit transaction control (i.e. autocommit is false) you'll
> >need to test for InTransaction before preparing your statement and, if
> >necessary, call StartTransaction. This causes the client to obtain a handle
> >for the transaction.
>Are you sure? I rarely use AutoCommit and would have run into trouble long
>time ago if I had to call StartTransaction explicitly (which I never ever
>do). Mind you, I check TransactionIsActive before Committing, but as far as
>I know IBO itself knows when to start a transaction - even when
>AutoCommit=false. I'd rather guess his trouble comes from starting a
>transaction twice or something like that (which I've never done, since I
>never explicitly start a transaction).
>(oops, I've just disagreed with Helen again :o)

No, we don't disagree. :)

Whether you check TransactionIsActive or go back to InTransaction/StartTransaction is really a matter of timing and *how* you are doing the explicit transaction - e.g. are you using the default transaction or a set of named transactions, if there is a chance that the previous instance of your transaction is uncompleted, etc. Use the one which suits the conditions.

Apologies if I made it sound like one hard-and-fast rule. My point was that under explicit transaction control, there are some things you need to check yourself, that Autocommit otherwise takes care of automatically.


All for Open and Open for All
InterBase Developer Initiative ยท