Subject RE: [firebird-support] Transaction Context and Triggers
Author Alan McDonald
> What is the PK of your log table?
> Are you sure the order of your PK matches the order
> of inserts in all cases?
> You can get surprising effects with timstamp fields, f.e.
> if the resolution of you timestamp is lower then you expect :-)
> That is the first thing I would verify at least.
> /Thekla

the PK of the log table is an integer and is independent of the PKs of the
other tables.
Within the context of a transaction, 'NOW' is the same time not sure about
CURRENT_TIMESTAMP
Alan

>
> Alan McDonald wrote:
>
> >I have tables with foreign keys into other tables.
> >In the context of one transaction:
> >1. insert into master
> > after insert trigger to insert into a log table
> >2. insert into child with PK of master
> > after insert trigger to insert into a log table
> >commit transaction
> >
> >now - up til now, the sequence of insertion into the log table
> has reflected
> >the above sequence. If I order by the log table PK I see this
> same sequence.
> >
> >but recently I see that it is possible to get the insertion into the log
> >table out of this sequence so the log table records an insertion to the
> >child sometimes before it records an insertion into the parent.
> This reverse
> >sequence is obviously not possible into the child first since it would
> >(does) raise an FK exception.
> >
> >Q: am I crazy - seeing things?, OR is there never any guarantee of this
> >seqence within the context of the same transaction and I've been
> lucky up to
> >now, OR is there a way of ensuring this sequence somehow that
> I'm not aware
> >of?
> >
> > regards
> > Alan McDonald
> >
> >
> >
> >
> >++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> >Visit http://firebird.sourceforge.net and click the Resources item
> >on the main (top) menu. Try Knowledgebase and FAQ links !
> >
> >Also search the knowledgebases at http://www.ibphoenix.com
> >
> >++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >
> >Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>
>
>