Subject | Re: [firebird-support] Maintaining proper generator values |
---|---|
Author | Doug Chamberlin |
Post date | 2003-11-11T20:06:24Z |
At 11/11/2003 02:52 PM (Tuesday), Milan Babuskov wrote:
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.
>One more thing, why max+1 ?Actually I just double checked and found that the value in use is really
>Setting it to max is enough.
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.