src/ResetableEntityManager.php
public function initializeObject($obj)
    {
        try{
            return $this->entityManager->initializeObject($obj);
        } catch(ORMException $e) {
            if (!$this->entityManager->isOpen()) {
                $this->resetEntityManager();
            }
            throw $e;
        }
    }
public function initializeObject($obj)
    {
        try{
            return $this->entityManager->initializeObject($obj);
        } catch(ORMException $e) {
            if (!$this->entityManager->isOpen()) {
                $this->resetEntityManager();
            }
            throw $e;
        }
    }
{@inheritDoc}