On Wed, 5 May 1999, Eric Handbury wrote:
> I am implementing a web-server with the SQL-engine being MySQL. Since all
> web transactions are state-less, how do developers resolve the concurrency
> issue where two people are trying to update the same record? Since each of
> the two people have their own copies of the current data, won't one of them
> clobber the others data?
Depends on the data. You can merge the data (i.e. #1 subtracts 50, #2
subtracts 50, you just do them consecutively) or you can deny update when
data has changed (#2 sends back both old and new data and if the database
doesn't match "old", the updated is refused and the client is shown the
current state of the db).
Fred Lindberg, Inf. Dis., WashU, St. Louis, MO, USA