Re: Lost Update Problem
| From: | Manuel Lemos | Date: | Sun, 19 Nov 2000 19:11:19 +0000 |
| Subject: | Re: Lost Update Problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26146@lists.php.net to get a copy of this message | ||
Hello rodrigo,
On 19-Nov-00 14:49:30, you wrote:
>Hello. I would like to know what are some of the methods the members of
>this list use to cope with the lost update problem.
>For those of you who don't know, the Lost Update Problem (as far as I
>know) is this: When two people pull a record to perform and UPDATE
>query. Both pull the record at the same time, but the save it to the
>database at different times. Neither of the users pulling the record
>knows what the other is doing to the data. The last one to submit the
>change is the one that will be recorded. Therefore, the update of the
>person who submits first is lost.
You need to use a transaction capable database. The PHP functions to use
transactions depend a lot on the database you use. You may want to check
Metabase, which a PHP database abstraction package that provides a uniform
API to each type of database resource for many DBMS, including
transactions. Take a look at its documentation because it contains a nice
explanation on how transactions can be used with Metabase.
http://phpclasses.UpperDesign.com/browse.html/package/20
Regards,
Manuel Lemos
Web Programming Components using PHP Classes.
Look at: http://phpclasses.UpperDesign.com/?user=mlemos@acm.org
--
E-mail: mlemos@acm.org
URL: http://www.mlemos.e-na.net/
PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
--