Hi fellow programmers, I was looking for how to keep integrity in some financial transactions and I saw this "This could even happen if you use transactions with the serializable isolation level." in the uniqueness page http://api.rubyonrails.org/classes/ActiveRecord/Va.... How this is possible with the serializablo isolation level? Aren't the select and update done in the same transaction?
on 2012-10-25 11:50
on 2012-10-26 14:22
On Wednesday, 24 October 2012 18:26:15 UTC-4, Filipe Giusti wrote: > They are, but that doesn't prevent races like the one in the documentation from occurring - in that case, both transactions find no conflicting records and create a row. As noted in the docs, if you really really need data consistency you're better off using a unique index and catching ActiveRecord::RecordNotUnique. --Matt Jones