projects
/
arvados.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4211e34
)
4533: Lock all tables, not just the ones with fixtures. refs #4533
author
Tom Clegg <tom@curoverse.com>
Fri, 5 Dec 2014 18:24:49 +0000
(13:24 -0500)
committer
Tom Clegg <tom@curoverse.com>
Fri, 5 Dec 2014 18:24:49 +0000
(13:24 -0500)
services/api/app/controllers/database_controller.rb
patch
|
blob
|
history
diff --git
a/services/api/app/controllers/database_controller.rb
b/services/api/app/controllers/database_controller.rb
index 831451435ef9f9adb47d974cdb91697f9db43f71..1e577ae54f410a84a680acd2ce4cb3a05f73599b 100644
(file)
--- 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"