/**
  * Clears the in-memory state of the persistence.
  *
  * Managed instances become detached, any fetches will
  * return data directly from the persistence "backend".
  *
  * @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\NotImplementedException
  * @return void
  */
 public function clearState()
 {
     $this->newObjects = array();
     $this->addedObjects = new ObjectStorage();
     $this->removedObjects = new ObjectStorage();
     $this->changedObjects = new ObjectStorage();
     $this->persistenceSession->destroy();
 }