Class: ActiveRecord::ConnectionAdapters::SavepointTransaction
- Inherits:
-
Transaction
- Object
- Transaction
- ActiveRecord::ConnectionAdapters::SavepointTransaction
- Defined in:
- lib/active_record/connection_adapters/abstract/transaction.rb
Instance Attribute Summary
Attributes inherited from Transaction
#connection, #joinable, #records, #savepoint_name, #state
Instance Method Summary collapse
- #commit ⇒ Object
- #full_rollback? ⇒ Boolean
-
#initialize(connection, savepoint_name, parent_transaction, options, *args) ⇒ SavepointTransaction
constructor
A new instance of SavepointTransaction.
- #rollback ⇒ Object
Methods inherited from Transaction
#add_record, #before_commit_records, #closed?, #commit_records, #joinable?, #open?, #rollback_records
Constructor Details
#initialize(connection, savepoint_name, parent_transaction, options, *args) ⇒ SavepointTransaction
Returns a new instance of SavepointTransaction.
136 137 138 139 140 141 142 143 144 145 |
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 136 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 Method Details
#commit ⇒ Object
152 153 154 155 |
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 152 def commit connection.release_savepoint(savepoint_name) super end |
#full_rollback? ⇒ Boolean
157 |
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 157 def full_rollback?; false; end |
#rollback ⇒ Object
147 148 149 150 |
# File 'lib/active_record/connection_adapters/abstract/transaction.rb', line 147 def rollback connection.rollback_to_savepoint(savepoint_name) super end |