Subject | Re: Generators for auto-increment - with override |
---|---|
Author | Adam |
Post date | 2005-01-05T23:14:58Z |
Ann is right. Even if other threads increment the generator, you will
only have some generator values that are never used.
Calls to generators are threadsafe, which means they must use some
form of mutex locking. The only possible bottleneck I can see is the
excessive calls to the generator, but I really doubt that will become
an issue.
--- In firebird-support@yahoogroups.com, "Ann W. Harrison"
<aharrison@i...> wrote:
only have some generator values that are never used.
Calls to generators are threadsafe, which means they must use some
form of mutex locking. The only possible bottleneck I can see is the
excessive calls to the generator, but I really doubt that will become
an issue.
--- In firebird-support@yahoogroups.com, "Ann W. Harrison"
<aharrison@i...> wrote:
> Alan McDonald wrote:would be
> >
> > between this line
> >>>> if (new.TEST_ID > GEN_VALUE) then
> > and this line
> >>>> GEN_VALUE = gen_id(GEN_TEST_ID,new.TEST_ID - GEN_VALUE);
> >
> > the generator counld be fired by someone else and thus GEN_VALUE
> > larger than expected at the third lineAll it
>
> True, but that doesn't matter in terms of database consistency.
> means is that you'll lose a few more generator values. The value
> returned by gen_id in the second line is never used.
>
>
> Regards,
>
>
> Ann