method
begin_isolated_db_transaction
v8.0.0 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter
begin_isolated_db_transaction(isolation)public
No documentation available.
# File activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb, line 227
def begin_isolated_db_transaction(isolation) # :nodoc:
# From MySQL manual: The [SET TRANSACTION] statement applies only to the next single transaction performed within the session.
# So we don't need to implement #reset_isolation_level
execute_batch(
["SET TRANSACTION ISOLATION LEVEL #{transaction_isolation_levels.fetch(isolation)}", "BEGIN"],
"TRANSACTION",
allow_retry: true,
materialize_transactions: false,
)
end