|
Posted by Bill Godfrey on 11/15/33 11:26
gordon@hammy.burditt.org (Gordon Burditt) wrote:
> If you perform a query like:
> update foo set bar=bar+1 where id = '$userIdx';
Ah ha. I must confess, I only know SQL from cribbing the commands
phpMyAdmin creates. I didn't realise you could do that.
> it should be atomic in the database without the need for explicit
> locks, as it's all done in one SQL statement.
If the database server (MySQL) will enforce atomic access, thats perfect.
> If your abstractions provide only the ability to read and write
> things, not atomic increments and decrements, perhaps your design
> needs changing.
I'm still in the poke-about-with-prototype-code phase, so no worries.
Thanks.
Bill, incremental.
--
http://billpg.me.uk/ usenet(at)billpg(dot)me(dot)uk
[Back to original message]
|