KatPadi's Point

Tag: rails lock

Race Condition and Rails with_lock

At one point in a dev’s life, race condition will be something that one needs to solve. Race conditions happen when the outcome is dependent on the sequence or timing of other events like saving a record to the database. If two users read a value from a record and then update it simultaneously, one of the…