         update: false
         remove: false
       }
+
+      $debug 'objects inserted into the database '
 
       # Finally, monitors events.
       loop


      dispatcherRegistered = false
      dispatcher = =>
        entered = $pluck entered, 'val'
        enterEvent = if entered.length
          JSON.stringify {
            jsonrpc: '2.0'
            method: 'all'
            params: {
              type: 'enter'
              items: entered
            }
          }
        exited = $pluck exited, 'val'
        exitEvent = if exited.length
          JSON.stringify {
            jsonrpc: '2.0'
            method: 'all'
            params: {
              type: 'exit'
              items: exited
            }
          }

        if entered.length
          connection.send enterEvent for id, connection of @connections
        if exited.length
          connection.send exitEvent for id, connection of @connections
        dispatcherRegistered = false
        entered = {}
        exited = {}

      @_xobjs.on 'any', (event, items) ->
        unless dispatcherRegistered
          dispatcherRegistered = true

      objects[ref] = pool

      # Then retrieve all other objects.
      n = 0
      $wait $Bluebird.map retrievableTypes, $coroutine (type) ->
        try
          for ref, object of $wait xapi.call "#{type}.get_all_records"
            normalizeObject object, ref, type

            objects[ref] = object

            n++
        catch error
          # It is possible that the method `TYPE.get_all_records` has
          # been deprecated, if that's the case, just ignores it.
          throw error unless error[0] is 'MESSAGE_REMOVED'

      $debug '%s objects fetched from %s@%s', n, server.username, server.host

      # Stores all objects.
      @_xobjs.set objects, {
