Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you make 2 updates, check the balance to ensure > 0, and rollback if < 0, and you do all of this in a transaction, doesn't concurrency no longer matter? If another transaction beats you to the punch, won't the balance check query reflect that?


Nope - this can happen with cards with a balance above zero too.

Look at what happens if you start two transfers of 1/2 the money from A to B.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: