From: Tom Clegg Date: Fri, 5 Dec 2014 18:24:49 +0000 (-0500) Subject: 4533: Lock all tables, not just the ones with fixtures. refs #4533 X-Git-Tag: 1.1.0~1938 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/a03a821d171ff8d6278272a7f6f0a935dca1fa8b 4533: Lock all tables, not just the ones with fixtures. refs #4533 --- diff --git a/services/api/app/controllers/database_controller.rb b/services/api/app/controllers/database_controller.rb index 831451435e..1e577ae54f 100644 --- a/services/api/app/controllers/database_controller.rb +++ b/services/api/app/controllers/database_controller.rb @@ -32,7 +32,7 @@ class DatabaseController < ApplicationController ActiveRecord::Base.transaction do # Avoid deadlock by locking all tables before doing anything # drastic. - table_names = '"' + fixturesets.sort.join('","') + '"' + table_names = '"' + ActiveRecord::Base.connection.tables.join('","') + '"' ActiveRecord::Base.connection.execute \ "LOCK TABLE #{table_names} IN ACCESS EXCLUSIVE MODE"