Subject RE: [Firebird-Architect] Database triggers
Author Leyne, Sean

> Adriano dos Santos Fernandes wrote:
> > Triggers fired in database events are useful for many things:
> > On connect/disconnect for logging or logon control.
> I thought that was what the security / authentication subsystem
> was supposed to do.

In principle, yes.

In practice, not always.

First, currently users are defined for the server, not the database.
Accordingly, a define user can connect to any database, and hold an open
connection, whether they have rights to any db objects in the db.

Next, you have a database user "User1" which has rights, but you want to
temporarily disable their access to a specific db.

> > On begin transaction for implementation of a "writable
> > id" (incrementing a generator and storing in a context variable).
> Don't we have a mechanism for creating transaction ids? Do we really
> need two different ones - one of which uses a generator so it can be
> bumped or reset?

The problem with the current transaction id is that it is reset with a
database restore.

The generator approach ensures that the ID is unique across restores.

> Before we get into syntax, lets look at semantics.

I agree.