     @_repositoryInstances = {}
     @_storeClasses = {}
     @_storeInstances = {}
-    @_pendingOperations = []
+    @_pendingPromises = []
     @_eventBus         = new @_eventric.EventBus @_eventric
     @projectionService = new @_eventric.Projection @_eventric, @
     @log = @_eventric.log



  destroy: ->
    Promise.all(@_pendingOperations).then =>
      @_eventBus.destroy().then =>
        @_isDestroyed = true


    repositoriesCache[aggregateName]


  _addPendingPromise: (pendingPromise) ->
    alwaysResolvingPromise = pendingPromise.catch ->
    @_pendingPromises.push alwaysResolvingPromise
    alwaysResolvingPromise.then =>
      @_pendingPromises.splice @_pendingPromises.indexOf(alwaysResolvingPromise), 1


  query: (queryName, params) ->
