Please, any idea how to manage concurent requests, 
for example like in a shopping cart?

Scenario:

1. I have a counter A (a field in a database row), set to 1, so A=1

2. A client wants 1 unit from A , it checks and it's OK,
   there is available.

3. Another client wants 1 unit from A, it checks, and it's OK,
   because first client did not subtracted yet 1 unit from A

4. The first client decreases A, so A=0

5. The scond client decreases A, so A=?... some garbage...

Any idea how to fix this transaction problem? If A is locked by the
first client in order to fix this problem, there is another question (the
really one!):

If the program terminates unexpectedly, what about A? 
It remains locked forever, and the second client cannot use it
anymore ?

thanx!
any idea really apreciated!

Daniel BI



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to