Subject Re: [firebird-support] Maintaining proper generator values
Author Doug Chamberlin
At 11/11/2003 02:52 PM (Tuesday), Milan Babuskov wrote:
>One more thing, why max+1 ?
>Setting it to max is enough.

Actually I just double checked and found that the value in use is really
max+20.

The reason for this is due to the fact that generator operations are
outside of transaction control. Therefore, in the sequence of 1)
determining of max value existing in tables, 2) determining current
generator value, 3) comparing the two, 4) resetting the generator, there
could be concurrent operations which are altering those values. Therefore,
we reset to max plus a comfortable margin which hopefully puts the new
value past any current activity effects.