Class: ActiveRecord::ConnectionAdapters::RestartParentTransaction
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Transaction
|
|
Instance Chain:
self,
Transaction
|
|
Inherits: |
ActiveRecord::ConnectionAdapters::Transaction
|
Defined in: | activerecord/lib/active_record/connection_adapters/abstract/transaction.rb |
Overview
Active Record Restart Parent Transaction
Class Method Summary
Transaction
- Inherited
Instance Attribute Summary
- #full_rollback? ⇒ Boolean readonly
- #restart readonly
Transaction
- Inherited
#closed?, #connection, #dirty?, #full_rollback?, #isolation_level, #joinable?, #materialized?, #open?, | |
#restartable? | Can this transaction’s current state be recreated by rollback+begin ? |
#savepoint_name, #state, #user_transaction, #written |
Instance Method Summary
Transaction
- Inherited
Constructor Details
.new(connection, parent_transaction, **options) ⇒ RestartParentTransaction
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 377
def initialize(connection, parent_transaction, ** ) super(connection, ** ) @parent = parent_transaction if isolation_level raise ActiveRecord::TransactionIsolationError, "cannot set transaction isolation in a nested transaction" end @parent.state.add_child(@state) end
Instance Attribute Details
#full_rollback? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 400
def full_rollback?; false; end
#restart (readonly)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 389
delegate :materialize!, :materialized?, :restart, to: :@parent
Instance Method Details
#commit
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 396
def commit @state.commit! end
#materialize!
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 389
delegate :materialize!, :materialized?, :restart, to: :@parent
#materialized? ⇒ Boolean
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 389
delegate :materialize!, :materialized?, :restart, to: :@parent
#rollback
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 391
def rollback @state.rollback! @parent.restart end