4 ms·
Umm ... and the 'Player.transaction' doesnt seem to be one then if it allows two transactions to overlap?
by aufreak3 14y ago
Umm ... and the 'Player.transaction' doesnt seem to be one then if it allows two transactions to overlap?
- EvilTrout 14y agoThere's a difference between a transaction that locks for writes and one that locks for reads. By default the reading is not locked in this (common) case.
- Strilanc 14y agoThat's a terrible default! Ignoring read-write races is a surefire way to... well, create bugs like the one in the post.
- emeraldd 14y agoThe common case is going to be many readers with a few or even a single writer. In that scenario, a read locked database would destroy any chance of operating at scale.
- marcosdumay 14y agoMany DBMS have a SELECT FOR UPDATE statement just for those cases you want to lock everybody out while just reading.
- Lozzer 14y agoFor a lot of RDBMS, transaction semantics can be later with different transaction isolation levels. There levels like repeatable read which work in this way, but the default level is usually weaker.