View Single Post

  #3 (permalink)  
Old 11-05-2005
Lars
 
Posts: n/a
Default Re: Atomicity problem / question

> I didn't say anything at all about a separate table.
>
> The method I mentioned is quite clean. One table, you simply insert
> the entire row with nothing in the other fields to get it to give you
> the auto-incremented value then use said value to key the update.


Ok. In my case, the table is for storing many different settings &
configuration options. It has the following columns: Category, Item &
Value. Most of the records in the table have nothing to do with unique
values, but a few of them do. E.g. Category = ControlNumbers, Item =
LastPONumber, Value = 1000

If user A and user B simultaneously request the next invoice number, one
should get 1001, the other 1002 and the LastPONumber field will be 1002
afterwards.

If I understand your approach correctly, I would either have to add an
auto-incremented field to this table, or have an extra table just for this
purpose.

Lars




Reply With Quote