Programming - - By Tim Lucas

ActiveRecord receives pessimistic locking

Jeremy Kemper just added pessimistic locking to ActiveRecord:


Person.transaction do 
  person = Person.find(1, :lock => true) 
  person.visits += 1 
  person.save! 
end 
Sponsors