Class: ActiveRecord::ConnectionAdapters::RealTransaction

Inherits:
Transaction
  • Object
show all
Defined in:
lib/active_record/connection_adapters/abstract/transaction.rb

Instance Attribute Summary

Attributes inherited from Transaction

#connection, #isolation_level, #records, #savepoint_name, #state

Instance Method Summary collapse

Methods inherited from Transaction

#add_record, #before_commit_records, #closed?, #commit_records, #full_rollback?, #initialize, #joinable?, #materialized?, #open?, #rollback_records

Constructor Details

This class inherits a constructor from ActiveRecord::ConnectionAdapters::Transaction

Instance Method Details

#commitObject



190
191
192
193
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 190

def commit
  connection.commit_db_transaction if materialized?
  @state.full_commit!
end

#materialize!Object



175
176
177
178
179
180
181
182
183
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 175

def materialize!
  if isolation_level
    connection.begin_isolated_db_transaction(isolation_level)
  else
    connection.begin_db_transaction
  end

  super
end

#rollbackObject



185
186
187
188
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 185

def rollback
  connection.rollback_db_transaction if materialized?
  @state.full_rollback!
end