Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: oracle - mysql comparison
"VC" <boston103_at_hotmail.com> schrieb im Newsbeitrag news:RfdLc.109372$WX.92600_at_attbi_s51...
> Here's another textbook example for you:
> ==
> There are two linked accounts (id=1 and id=2) in a bank. A transaction
> might look as follows:
>
> == withdraw from 1
> select amount into x from accounts where id=1
> select amount into y from accounts where id=2
> if x+y >= withdrawal then update accounts set amount=amount-withdrawal
> where id=1
> commit
> =====
>
> Any commercial locking scheduler will handle the scenario correctly. Oracle
> won't.
Sorry for butting in but I'm just trying to learn here, so what would go wrong?
And what about "select for update" in oracle? It's supposed to lock the rows it hits.
Lots of Greetings!
Volker
Received on Tue Jul 20 2004 - 13:38:29 CDT