On 06.09.2019 14:14, Carlos H. Cantu wrote:
Re: [Firebird-devel] Inserts and FKs
Hi
"tx2 inserts a detail record in TableB
Trigger on TableB tries to update master record,
since the record is still not visible for this snapshot,
update has null effect"
I do not understand this point. If table B i detail it can only insert
record for visible to it record in master. Or do you in your trigger
you update whole table master not only master record of this detail?
Trigger updates only the master record. The problem is exactly the
fact that the insert of the detail record doesn't fail, because FK is
out of transaction control so it can see the master record (but the
update can't see it).
Certainly you can repeat search for master record in trigger but IMHO
that's not beautiful solution.
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel