Class: ActiveRecord::ConnectionAdapters::RealTransaction

Inherits:
OpenTransaction show all
Defined in:
activerecord/lib/active_record/connection_adapters/abstract/transaction.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from OpenTransaction

#joinable, #parent, #records

Attributes inherited from Transaction

#connection

Instance Method Summary collapse

Methods inherited from OpenTransaction

#add_record, #begin, #closed?, #commit, #commit_records, #finishing?, #joinable?, #number, #open?, #rollback, #rollback_records

Methods inherited from Transaction

#state

Constructor Details

#initialize(connection, parent, options = {}) ⇒ RealTransaction

Returns a new instance of RealTransaction.



160
161
162
163
164
165
166
167
168
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 160

def initialize(connection, parent, options = {})
  super

  if options[:isolation]
    connection.begin_isolated_db_transaction(options[:isolation])
  else
    connection.begin_db_transaction
  end
end

Instance Method Details

#perform_commitObject



175
176
177
178
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 175

def perform_commit
  connection.commit_db_transaction
  commit_records
end

#perform_rollbackObject



170
171
172
173
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 170

def perform_rollback
  connection.rollback_db_transaction
  rollback_records
end