Skip to content

Commit 6b31617

Browse files
committed
aaded materialize_transactions guard to connection uses.
for implementing supports for lazy transactions rails/rails#32647 (comment)
1 parent 8215e09 commit 6b31617

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/active_record/connection_adapters/sqlserver/database_statements.rb

+6
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ def default_insert_value(column)
136136
# === SQLServer Specific ======================================== #
137137

138138
def execute_procedure(proc_name, *variables)
139+
materialize_transactions
140+
139141
vars = if variables.any? && variables.first.is_a?(Hash)
140142
variables.first.map { |k, v| "@#{k} = #{quote(v)}" }
141143
else
@@ -268,6 +270,8 @@ def set_identity_insert(table_name, enable = true)
268270
# === SQLServer Specific (Executing) ============================ #
269271

270272
def do_execute(sql, name = 'SQL')
273+
materialize_transactions
274+
271275
log(sql, name) { raw_connection_do(sql) }
272276
end
273277

@@ -378,6 +382,8 @@ def identity_columns(table_name)
378382
# === SQLServer Specific (Selecting) ============================ #
379383

380384
def raw_select(sql, name = 'SQL', binds = [], options = {})
385+
materialize_transactions
386+
381387
log(sql, name, binds) { _raw_select(sql, options) }
382388
end
383389

0 commit comments

Comments
 (0)