Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Transaction counter
Fri, Jan 6 2006 7:09 AMPermanent Link

"Ralf Mimoun"
Tim,

for a project I added a transaction counter. You know:

MyDBStartTransaction: if counter = 0 then StartTransaction; Counter :=
Counter+1;

MyDBCommit: if Counter := Count - 1; if Counter = 0 then Commit;

MyDBRollback: if Counter := Count - 1; if Counter = 0 then Rollback;

Maybe you can integrate something like that in DBISAM directly.

Ralf

Fri, Jan 6 2006 12:37 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ralf,

<< for a project I added a transaction counter. You know:

.....

Maybe you can integrate something like that in DBISAM directly. >>

Hmm, I'm thinking that this could possibly cause some undesirable
side-effects, particularly some nasty and hard-to-find bugs in terms of
transactions not committing, etc.


--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Jan 6 2006 4:08 PMPermanent Link

"Ralf Mimoun"
Tim Young [Elevate Software] wrote:
> Ralf,
>
> << for a project I added a transaction counter. You know:
>
> ....
>
> Maybe you can integrate something like that in DBISAM directly. >>
>
> Hmm, I'm thinking that this could possibly cause some undesirable
> side-effects, particularly some nasty and hard-to-find bugs in terms
> of transactions not committing, etc.

That's always the case with nested transactions. There is always the
possibility to add a  flag to the database component
"AllowNestedTransactions", default False. Yes, property inflation SmileBut
without nested transactions, many simply don't use transactions at all,
leading to some real problems, and the rest has to write silly code to
circumvent problems - code than can be buggy, too. To make sure that every
transaction gets a commit or rollback, a simply try/except/raise is
sufficient. Should be standard today, and yes, I know, that it is not Smile

Oh, and the TDBISAMDatabase component could throw an exception when
destroyed if there are any dangling transactions.

Ralf

Image