SQL: Incorrect by Construction

20 points by chreke


fanf

The solution is to choose a strong enough isolation level. Yes, databases usually choose performance rather than strictly serializable transactions, but at least SQL allows you to adjust it to your preferences. And you don’t have to fart around with explicit locks! The main downside is that conflicting transactions are more likely to abort, so you might want a retry loop; but that can turn deadlocks into livelocks, so be careful.