Subject Re: [firebird-support] Re: Recursive trigger
Author Lucas Franzen
Donald,

> I've burnt my fingers a number of times with insert triggers setting the PK
> value from a generator, whilst the generator value is lower than the current
> highest value of the PK.... For each "PK exception", the generator is still
> incremented by one, until it's higher than the current highest PK value,
> upon which the errors misteriously disappear (this is one case where user
> persistence will actually help, they simply need to retry inserting a new
> record until the error goes away)

If you have primary key values that are higher than the current
generator value then this is not a problem of the database, it's a
problem of a bad application design, since that means that:

either: there are different generators used for one table
or: it is possible to circumvent the generator
or: it is possible to reset the generator
or: a mixture of all above.

Using generatorsd IS safe.
But you've got to tie them to them without exception then.

And *never* disable triggers temporarily if you haven't got single user
access and really know why you're doing so.

Luc.