Class: ActiveRecord::ConnectionAdapters::SavepointTransaction
Relationships & Source Files | |
Inherits: |
ActiveRecord::ConnectionAdapters::Transaction
|
Defined in: | activerecord/lib/active_record/connection_adapters/abstract/transaction.rb |
Class Method Summary
Instance Attribute Summary
- #full_rollback? ⇒ Boolean readonly
Instance Method Summary
Constructor Details
.new(connection, savepoint_name, parent_transaction, options, *args) ⇒ SavepointTransaction
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 145
def initialize(connection, savepoint_name, parent_transaction, , *args) super(connection, , *args) parent_transaction.state.add_child(@state) if [:isolation] raise ActiveRecord::TransactionIsolationError, "cannot set transaction isolation in a nested transaction" end connection.create_savepoint(@savepoint_name = savepoint_name) end
Instance Attribute Details
#full_rollback? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 166
def full_rollback?; false; end
Instance Method Details
#commit
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 161
def commit connection.release_savepoint(savepoint_name) @state.commit! end
#rollback
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/abstract/transaction.rb', line 156
def rollback connection.rollback_to_savepoint(savepoint_name) @state.rollback! end