Subject | RE: [firebird-support] Transaction Context and Triggers |
---|---|
Author | Alan McDonald |
Post date | 2006-03-30T10:19:04Z |
> At 07:35 PM 30/03/2006, you wrote:when all the actions are complete and the transaction is committed, I select
>
>
> >I'm talking about vanilla inserts - no selects here at all. The
> row with the
> >lower generator is not necessarily WRITTEN first but the gen value shoul
> >have been acquired first. that's my point. But I have seen that
> within one
> >transaction, the after insert trigger on a child table acquires
> the (lower)
> >gen value BEFORE the after insert trigger on the master table....
>
> OK, but you stated differently - you said that if you selected
> ordered by PK, it was the same as before. But now, in later posts
> you are saying it is different.
>
> ./heLen
from the log table to see the sequence of log row creation.
If I select in PK ascending order, I should see the first of my actions
before the last. The insert into the master table (from my client app) was
my first action, which fired it's after insert trigger. This after insert
action should acquire a lower gen value. Then my client app inserts into the
child table, this table fires it's after insert trigger and the resultant
insert (into the log table) should aquire the next gen value for the log
table.
But when I select on the log table I see the child table insert was logged
BEFORE the master table insert. It's (the child record's insert) was given
it's log table gen value before the master table insert log record was given
it's value.
Alan