Skip to content
This repository
Browse code

Added a note that optimistic locking also needs a hidden field to fun…

…ction across web workers.
  • Loading branch information...
commit 80bcfb00f71dbacd6af0a76429faa5d104ae3a36 1 parent 7c6d437
Joost Baaij authored October 25, 2011
3  activerecord/lib/active_record/locking/optimistic.rb
@@ -37,6 +37,9 @@ module Locking
37 37
     # You're then responsible for dealing with the conflict by rescuing the exception and either rolling back, merging,
38 38
     # or otherwise apply the business logic needed to resolve the conflict.
39 39
     #
  40
+    # This locking mechanism will function inside a single Ruby process. To make it work across all
  41
+    # web requests, the recommended approach is to add +lock_version+ as a hidden field to your form.
  42
+    #
40 43
     # You must ensure that your database schema defaults the +lock_version+ column to 0.
41 44
     #
42 45
     # This behavior can be turned off by setting <tt>ActiveRecord::Base.lock_optimistically = false</tt>.

0 notes on commit 80bcfb0

Please sign in to comment.
Something went wrong with that request. Please try again.