Subject RE: [Firebird-Architect] Autonomous Transaction Routines
Author Claudio Valderrama C.
> -----Original Message-----
> From: Firebird-Architect@yahoogroups.com
> [mailto:Firebird-Architect@yahoogroups.com]On Behalf Of Vlad Khorsun
> Sent: Sábado, 10 de Noviembre de 2007 7:22
>
> >> > If yes, do we have a field in mon$transactions to indicate
> their special
> >> > nature?
> >>
> >> ID of "parent" transaction ? I like it
> >
> > How do you tell which is the parent and which is the child? How
> do you tell
> > the difference between a normal txn that spawned two autonomous
> txn and a
> > normal txn that spawned an auto txn that in turn spawned
> another auto txn?
>
> Lets look :
>
> // here we work in user transaction context
> ...
> BEGIN AUTONOMOUS
> // here we work in 1st autonomous tx context
> ...
> BEGIN AUTONOMOUS
> // here we work in 2nd autonomous tx context
> ...
> END
> // here we work in 1st autonomous tx context
> ...
> END
> // here we work in user tx context again
> ...
> BEGIN AUTONOMOUS
> // here we work in 3rd autonomous tx context
> ...
> END
> // here we work in user tx context again
>
> You see - all this transactions organized in kind of stack
> and at each stage
> we worked at one transaction context which is clearly determined by syntax

I understand that, but how to you get that information from
mon$transactions? You suggest to reuse the ID of the parent. What will the
monitoring table show when I'm in the 2nd auto txn? Three txn with the same
ID? My question is, then:

looking at mon$transactions, how do you tell which is the parent and which
is the child? How do you tell the difference between a normal txn that
spawned two autonomous txn and a normal txn that spawned an auto txn that in
turn spawned another auto txn? If they share the id, then two auto txn that
are running in parallel and two nested auto txn are the same when looking at
mon$transactions.

C.