Skip to content

Commit e4b4c50

Browse files
authored
Check for transaction before invalidating the state
1 parent dcc75f9 commit e4b4c50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/connection_adapters/abstract_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ def invalidate_transaction(exception)
10121012
return unless exception.is_a?(TransactionRollbackError)
10131013
return unless savepoint_errors_invalidate_transactions?
10141014

1015-
current_transaction.state.invalidate! if current_transaction
1015+
current_transaction.state.invalidate! if current_transaction.open?
10161016
end
10171017

10181018
def retryable_query_error?(exception)

0 commit comments

Comments
 (0)