Class: ActiveRecord::ConnectionAdapters::RealTransaction
- Inherits:
-
OpenTransaction
- Object
- Transaction
- OpenTransaction
- ActiveRecord::ConnectionAdapters::RealTransaction
- Defined in:
- activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes inherited from OpenTransaction
Attributes inherited from Transaction
Instance Method Summary collapse
-
#initialize(connection, parent, options = {}) ⇒ RealTransaction
constructor
A new instance of RealTransaction.
- #perform_commit ⇒ Object
- #perform_rollback ⇒ Object
Methods inherited from OpenTransaction
#add_record, #begin, #closed?, #commit, #commit_records, #finishing?, #joinable?, #number, #open?, #rollback, #rollback_records
Methods inherited from Transaction
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, = {}) super if [:isolation] connection.begin_isolated_db_transaction([:isolation]) else connection.begin_db_transaction end end |
Instance Method Details
#perform_commit ⇒ Object
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_rollback ⇒ Object
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 |