##// END OF EJS Templates
Fixed dead locks with SQLServer....
Jean-Philippe Lang -
r13462:a7378e450d25
parent child
Show More
@@ -153,8 +153,8 module Redmine
153 153 if self.class.connection.adapter_name =~ /sqlserver/i
154 154 lock = "WITH (ROWLOCK HOLDLOCK UPDLOCK)"
155 155 end
156 sets_to_lock = [id, parent_id].compact
157 self.class.reorder(:id).where("root_id IN (SELECT root_id FROM #{self.class.table_name} WHERE id IN (?))", sets_to_lock).lock(lock).ids
156 sets_to_lock = [root_id, parent.try(:root_id)].compact.uniq
157 self.class.reorder(:id).where(:root_id => sets_to_lock).lock(lock).ids
158 158 end
159 159
160 160 def nested_set_scope
General Comments 0
You need to be logged in to leave comments. Login now