This project is archived and is in readonly mode.

#6399 ✓resolved
Jesse Storimer

Allow database specific locking clauses to be used

Reported by Jesse Storimer | February 9th, 2011 @ 04:03 PM | in 3.0.5

AR docs say that you can use a custom locking clause like so:

Product.find(1, :lock => 'LOCK IN SHARE MODE')
 # select * from products where id=1 LOCK IN SHARE MODE
 # https://github.com/rails/rails/blob/master/activerecord/lib/active_record/locking/pessimistic.rb#L11-12

But currently arel always uses 'FOR UPDATE' (https://github.com/rails/arel/blob/master/lib/arel/visitors/mysql.r....

This pull request for arel fixes the bug: https://github.com/rails/arel/pull/21

Wanted to make sure this makes it in for the 3.0.5 release.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages