Subject | Re: Feature request : Generator tables |
---|---|
Author | benmarron |
Post date | 2004-02-20T09:51:34Z |
> Yes, of course. However, there are ways to get around this problem.For
> example, what I usually do, is first get the generator value anddisplay
> it, using "gen_id(gen_name, 0) + 1", and then, if and when the userIn my opinion, not multi-user safe. Example :
> confirms, I actually increment the generator. This avoids all
> concurrency issues in a simple way.
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 !!!