def end_transaction
      case @transaction_stack.length
      when 0
        PEROBS.log.fatal 'No ongoing transaction to end'
      when 1
        # All transactions completed successfully. Write all modified objects
        # into the backend storage.
        @transaction_stack.pop.each { |id| @transaction_objects[id]._sync }
        @transaction_objects = ::Hash.new
      else
        # A nested transaction completed successfully. We add the list of
        # modified objects to the list of the enclosing transaction.
        transactions = @transaction_stack.pop
        # Merge the two lists
        @transaction_stack.push(@transaction_stack.pop + transactions)
        # Ensure that each object is only included once in the list.
        @transaction_stack.last.uniq!
      end
    end
def end_transaction
      case @transaction_stack.length
      when 0
        PEROBS.log.fatal 'No ongoing transaction to end'
      when 1
        # All transactions completed successfully. Write all modified objects
        # into the backend storage.
        @transaction_stack.pop.each { |id| @transaction_objects[id]._sync }
        @transaction_objects = ::Hash.new
      else
        # A nested transaction completed successfully. We add the list of
        # modified objects to the list of the enclosing transaction.
        transactions = @transaction_stack.pop
        # Merge the two lists
        @transaction_stack.push(@transaction_stack.pop + transactions)
        # Ensure that each object is only included once in the list.
        @transaction_stack.last.uniq!
      end
    end
Tell the cache to end the currently active transaction. All write
 operations of the current transaction will be synced to the storage
 back-end.