Active Record Restart Parent Transaction

Methods

Class Public methods

new(connection, parent_transaction, **options)

📝 Source code
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 296
      def initialize(connection, parent_transaction, **options)
        super(connection, **options)

        @parent = parent_transaction

        if isolation_level
          raise ActiveRecord::TransactionIsolationError, "cannot set transaction isolation in a nested transaction"
        end

        @parent.state.add_child(@state)
      end
🔎 See on GitHub

Instance Public methods

commit()

📝 Source code
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 315
      def commit
        @state.commit!
      end
🔎 See on GitHub

full_rollback?()

📝 Source code
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 319
      def full_rollback?; false; end
🔎 See on GitHub

rollback()

📝 Source code
# File activerecord/lib/active_record/connection_adapters/abstract/transaction.rb, line 310
      def rollback
        @state.rollback!
        @parent.restart
      end
🔎 See on GitHub