diff options
author | Keenan Brock <keenan@thebrocks.net> | 2016-04-20 11:23:56 -0400 |
---|---|---|
committer | Keenan Brock <keenan@thebrocks.net> | 2016-04-28 17:48:41 -0400 |
commit | dffbba1e2aed01748cfc79327946175ad51f6b4f (patch) | |
tree | 801974e5d7c2a14b1a7855209ee9c743c93857f0 /activerecord | |
parent | ef5c46d2ee8dc8da20f54dbedc9805f71791d75c (diff) | |
download | rails-dffbba1e2aed01748cfc79327946175ad51f6b4f.tar.gz rails-dffbba1e2aed01748cfc79327946175ad51f6b4f.tar.bz2 rails-dffbba1e2aed01748cfc79327946175ad51f6b4f.zip |
schema_load triggers 2nd schema_load (via locking)
Currently, loading the schema (schema_load)
accesses the locking column (locking_column)
which defaults the value (reset_locking_column)
which invalidates the schema (reload_schema_from_cache)
which forces another schema load.
Good news:
The second schema_load does accesses locking_column,
but locking_column is set, so it does not reset_locking_column
and it does not trigger an infinite loop.
The solution is not invalidate the cache while default locking_column
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/locking/optimistic.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/locking/optimistic.rb b/activerecord/lib/active_record/locking/optimistic.rb index 1040327a5d..1e37ffefc6 100644 --- a/activerecord/lib/active_record/locking/optimistic.rb +++ b/activerecord/lib/active_record/locking/optimistic.rb @@ -150,7 +150,7 @@ module ActiveRecord # The version column used for optimistic locking. Defaults to +lock_version+. def locking_column - reset_locking_column unless defined?(@locking_column) + @locking_column = DEFAULT_LOCKING_COLUMN unless defined?(@locking_column) @locking_column end |