# File lib/dm-core/transaction.rb, line 153
    def within
      unless block_given?
        raise 'No block provided'
      end

      unless @state == :begin
        raise "Illegal state for within: #{@state}"
      end

      @adapters.each do |adapter, state|
        adapter.push_transaction(self)
      end

      begin
        yield self
      ensure
        @adapters.each do |adapter, state|
          adapter.pop_transaction
        end
      end
    end