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.
164 165 166 167 168 169 170 171 172 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 164 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
179 180 181 182 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 179 def perform_commit connection.commit_db_transaction commit_records end |
#perform_rollback ⇒ Object
174 175 176 177 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 174 def perform_rollback connection.rollback_db_transaction rollback_records end |