Browse Source

Fixed bug: Cache invalidation race condition in concurrent threads cause access to newly added ObjectManager attributes to fail.

Thorsten Eckel 7 years ago
parent
commit
1985a6af52
1 changed files with 3 additions and 0 deletions
  1. 3 0
      app/models/object_manager/attribute.rb

+ 3 - 0
app/models/object_manager/attribute.rb

@@ -720,6 +720,9 @@ to send no browser reload event, pass false
   def self.reset_database_info(model)
     model.connection.schema_cache.clear!
     model.reset_column_information
+    # rebuild columns cache to reduce the risk of
+    # race conditions in re-setting it with outdated data
+    model.columns
   end
 
   def check_name