Subject RE: [Firebird-Architect] Database triggers
Author Claudio Valderrama C.
> -----Original Message-----
> From:
> []On Behalf Of Adriano dos
> Santos Fernandes
> Triggers fired in database events are useful for many things:
> On connect/disconnect for logging or logon control.
> On begin transaction for implementation of a "writable transaction
> id" (incrementing a generator and storing in a context variable).
> On commit triggers for business rules validations.

Sorry to be late, but couldn't we start summarizing what are the operations
that users often ask for in fb-support?

AFAIK, people typically want to run some code on a successful attachment and
when the attachment is being finished. Failed connections may be saved into
the log file. Otherwise, we need to agree which user will be used to run
BEFORE CONNECT and AFTER DISCONNECT triggers. Are they useful, BTW?

Probably someone sees the necessity of ON COMMIT triggers. I'm personally
happy with deferred constraints that can be verified at commit time instead
of after every operation.

Why would I want to log ON ROLLBACK actions? Supposedly, after a rollback,
everything was undone, except if you are including in the txn some devices
that aren't db servers, some trigger called a tricky UDF that does
filesystem or network operations, etc.