NYCPHP Meetup

NYPHP.org

[nycphp-talk] MySQL concurrency 101

David Mintz dmintz at davidmintz.org
Thu Dec 11 12:12:31 EST 2003



Basic question. What is/are the recommended strategies for dealing with
the lost update problem in a PHP/MySQL application? The scenario I'm
thinking of is not the old shirt inventory example which can be solved
with relative as opposed to absolute updates. I'm thinking:  User1
requests a page containing a form populated by a row of John Customer's
data from a table; so does User2. User1 updates John Customer's work phone
in the form and User2 updates John Customer's home phone. User1 submits
form/updates table, then User2 does likewise, overwriting User1's update.

I've done considerable RTFM and I'm conversant with locks, transactions,
etc. I'm uncertain about how to put it all together in a web app, i.e.,
with lots of short-lived independent scripts running in a stateless
environment.

The possible approaches I can think of are a little cumbersome -- I'll
spare you, for the sake of brevity.

Any pointers to tutorials, articles etc are appreciated. Thanks.


---
David Mintz
http://davidmintz.org/

        "Anybody else got a problem with Webistics?" -- Sopranos 24:17



More information about the talk mailing list