public function clearState()
    {
        parent::clearState();
        $this->addedObjects = new \SplObjectStorage();
        $this->removedObjects = new \SplObjectStorage();
        $this->changedObjects = new \SplObjectStorage();
        $this->persistenceSession->destroy();
        $this->hasUnpersistedChanges = false;
    }