Class: ActiveRecord::ConnectionAdapters::RealTransaction
- Inherits:
-
Transaction
- Object
- Transaction
- ActiveRecord::ConnectionAdapters::RealTransaction
- Defined in:
- lib/active_record/connection_adapters/abstract/transaction.rb
Instance Attribute Summary
Attributes inherited from Transaction
#connection, #isolation_level, #savepoint_name, #state, #written
Instance Method Summary collapse
Methods inherited from Transaction
#add_record, #before_commit_records, #closed?, #commit_records, #full_rollback?, #initialize, #joinable?, #materialized?, #open?, #records, #rollback_records
Constructor Details
This class inherits a constructor from ActiveRecord::ConnectionAdapters::Transaction
Instance Method Details
#commit ⇒ Object
218 219 220 221 |
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 218 def commit connection.commit_db_transaction if materialized? @state.full_commit! end |
#materialize! ⇒ Object
203 204 205 206 207 208 209 210 211 |
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 203 def materialize! if isolation_level connection.begin_isolated_db_transaction(isolation_level) else connection.begin_db_transaction end super end |
#rollback ⇒ Object
213 214 215 216 |
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 213 def rollback connection.rollback_db_transaction if materialized? @state.full_rollback! end |