Methods
Class Public methods
new(connection, savepoint_name, parent_transaction, options, *args)
📝 Source code
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 145
def initialize(connection, savepoint_name, parent_transaction, options, *args)
super(connection, options, *args)
parent_transaction.state.add_child(@state)
if options[:isolation]
raise ActiveRecord::TransactionIsolationError, "cannot set transaction isolation in a nested transaction"
end
connection.create_savepoint(@savepoint_name = savepoint_name)
end
🔎 See on GitHub
Instance Public methods
commit()
📝 Source code
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 161
def commit
connection.release_savepoint(savepoint_name)
@state.commit!
end
🔎 See on GitHub
full_rollback?()
📝 Source code
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 166
def full_rollback?; false; end
🔎 See on GitHub
rollback()
📝 Source code
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 156
def rollback
connection.rollback_to_savepoint(savepoint_name)
@state.rollback!
end
🔎 See on GitHub