Class: ActiveRecord::ConnectionAdapters::RealTransaction

Inherits:
OpenTransaction show all
Defined in:
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.



164
165
166
167
168
169
170
171
172
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 164

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



179
180
181
182
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 179

def perform_commit
  connection.commit_db_transaction
  commit_records
end

#perform_rollbackObject



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

def perform_rollback
  connection.rollback_db_transaction
  rollback_records
end