Ben Adida wrote:
> begin transaction
> select balance from accounts where account_id=2 for update
>
> will select the balance and lock the row for account #2
> You can then perform some math on the balance, and do something like:
>
> update accounts set balance= $new_balance where account_id=2
> end transaction
>
Great - I assume end transaction is going to do a commit. If you don't
do an end transaction and you don't issue a rollback... I assume it
rolls back?
This is pretty slick - over the last month or so I've come up with about
8 different places where I really wish I had transactions/rollbacks on
SourceForge. Also running into lots of places where I really, really
wish I had fscking subselects...
Tim
--
Founder - PHPBuilder.com / Geocrawler.com
Lead Developer - SourceForge
VA Linux Systems
408-542-5723