Subject Re: [firebird-support] Re: Generators for auto-increment - with override
Author Doug Chamberlin
At 1/7/2005 06:56 PM (Friday), Daniel L. Miller wrote:
> Question #1: Where should I implement "generator protection" -
>before or after inserts/updates?
> Question #2: Should I keep this "protection" in a production

The last time I used such "generator protection", I placed it in my major
application so that it ran right after the connection to the database was
made. That way I could be sure every time the application ran it would be
using good generated values. The logic was controlled by a configuration
option so it could be easily turned off if their were complaints about
performance (there never were).

If I were to put such logic into the database, itself, I would write a
single stored procedure which handled it (ADJUST_GENERATORS) and execute it
on an ad hoc basis, perhaps before or after a backup/restore cycle. I would
NOT put such logic into any trigger. I see that as overkill.