Subject | Re: [firebird-support] Re: Feature request : Generator tables |
---|---|
Author | Jonathan Neve |
Post date | 2004-02-20T10:23:45Z |
benmarron a écrit :
That's exactly what I want. Obviously, it won't be unique before
confirming, and obviously, the code might have to change when they
confirm the record. That's the idea of confirming. Also, by confirming,
what I meant was simply inserting the record. So, the value before
inserting is of no importance.
Jonathan Neve.
>In my opinion, not multi-user safe. Example :What's wrong with that?
>
>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 !!!
>
>
That's exactly what I want. Obviously, it won't be unique before
confirming, and obviously, the code might have to change when they
confirm the record. That's the idea of confirming. Also, by confirming,
what I meant was simply inserting the record. So, the value before
inserting is of no importance.
Jonathan Neve.