Subject | Re: [firebird-support] Re: Feature request : Generator tables |
---|---|
Author | Markus Ostenried |
Post date | 2004-02-20T10:24:03Z |
At 09:51 Friday, 20.02.2004 +0000, you wrote:
bye,
Markus
> > Yes, of course. However, there are ways to get around this problem. ForI was about to write down this example, too... :-)
> > example, what I usually do, is first get the generator value and display
> > it, using "gen_id(gen_name, 0) + 1", and then, if and when the user
> > confirms, I actually increment the generator. This avoids all
> > concurrency issues in a simple way.
>
>In my opinion, not multi-user safe. Example :
>
>Suppose generator gen_name is 10
>
>1. User A see your "gen_id(gen_name, 0) +1" = 11
>2. User B see your "gen_id(gen_name, 0) +1" = 11
>3. User B confirms and get "gen_id(gen_name, 1)" = 11
>4. User A confirms and get "gen_id(gen_name, 1)" = 12 !!!
bye,
Markus