Class: ActiveRecord::ConnectionAdapters::RealTransaction
- Inherits:
-
Transaction
- Object
- Transaction
- ActiveRecord::ConnectionAdapters::RealTransaction
- Defined in:
- activerecord/lib/active_record/connection_adapters/abstract/transaction.rb
Instance Attribute Summary
Attributes inherited from Transaction
#connection, #isolation_level, #records, #savepoint_name, #state
Instance Method Summary collapse
Methods inherited from Transaction
#add_record, #before_commit_records, #closed?, #commit_records, #full_rollback?, #initialize, #joinable?, #materialized?, #open?, #rollback_records
Constructor Details
This class inherits a constructor from ActiveRecord::ConnectionAdapters::Transaction
Instance Method Details
#commit ⇒ Object
194 195 196 197 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 194 def commit connection.commit_db_transaction if materialized? @state.full_commit! end |
#materialize! ⇒ Object
179 180 181 182 183 184 185 186 187 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 179 def materialize! if isolation_level connection.begin_isolated_db_transaction(isolation_level) else connection.begin_db_transaction end super end |
#rollback ⇒ Object
189 190 191 192 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 189 def rollback connection.rollback_db_transaction if materialized? @state.full_rollback! end |