@@ -3,11 +3,11 @@ module ConnectionAdapters
33 module Sqlserver
44 module CoreExt
55 module DatabaseStatements
6-
6+
77 # This is a copy of the current (3.1.3) ActiveRecord's transaction method. We should propose
8- # a patch to the default transaction method to make it more callback for adapters that want to
8+ # a patch to the default transaction method to make it more callback for adapters that want to
99 # do deadlock retry logic. Because this is a copy, we really need to keep an eye out on this when
10- # upgradding the adapter.
10+ # upgradding the adapter.
1111 def transaction_with_retry_deadlock_victim ( options = { } )
1212 options . assert_valid_keys :requires_new , :joinable
1313
@@ -30,7 +30,6 @@ def transaction_with_retry_deadlock_victim(options = {})
3030 elsif requires_new
3131 create_savepoint
3232 end
33- increment_open_transactions
3433 transaction_open = true
3534 @_current_transaction_records . push ( [ ] )
3635 end
@@ -39,7 +38,6 @@ def transaction_with_retry_deadlock_victim(options = {})
3938 rescue Exception => database_transaction_rollback
4039 if transaction_open && !outside_transaction?
4140 transaction_open = false
42- decrement_open_transactions
4341 # handle deadlock victim retries at the outermost transaction
4442 if open_transactions == 0
4543 if database_transaction_rollback . is_a? ( ::ActiveRecord ::DeadlockVictim )
@@ -63,7 +61,6 @@ def transaction_with_retry_deadlock_victim(options = {})
6361 if outside_transaction?
6462 @open_transactions = 0
6563 elsif transaction_open
66- decrement_open_transactions
6764 begin
6865 if open_transactions == 0
6966 commit_db_transaction
@@ -88,7 +85,7 @@ def transaction_with_retry_deadlock_victim(options = {})
8885 end
8986 end
9087 end
91-
88+
9289 end
9390 end
9491 end
0 commit comments