News for hackers. Stuff that matters.
Re:How our users exploited concurrency and how we fixed it by EvilTrout on Friday January 11, 2013 @12:04PM (#5043576)
facepalm

I forgot a very important part of the query:

row_count = Goal.update_all "completed = true", ["player_id = ? AND completed = false", player.id]

If you update where completed = false, the rowcount will only be 1 when the update works.

(I've updated the blog post.)

There are no comments on this comment yet.