Subject Quick storage for one INTEGER variable on Firebird 1.5
Author PenWin

Using Firebird 1.5, I need to store one INTEGER variable
(CURRENT_TRANSACTION) somewhere where it will be quickly available
(because I will need to read this variable in a trigger, and I expect
this trigger to be called millions of times in a row). If I used
Firebird 2.0, I would use RDB$SET_CONTEXT and RDB$GET_CONTEXT, but as
those are not available, I have to use other means. Which of these
possibles would be the best? (Note: I will only ever need one instance,
common to all connections)

1) Separate table: SELECT stored_value FROM storage_table
2) Generator: SELECT GEN_ID(stored_value, 0) FROM rdb$database
3) UDF (I am not sure if I can get persistent memory storage with an
UDF, but I could certainly store the desired value in a file)

Or maybe I am approaching the problem from the wrong side completely?
Basically, I need to stop a trigger from executing, but only for one
given transaction; the trigger should fire normally for other transactions.