src/ResetableEntityManager.php
public function refresh($entity)
    {
        try{
            return $this->entityManager->refresh($entity);
        } catch(ORMException $e) {
            if (!$this->entityManager->isOpen()) {
                $this->resetEntityManager();
            }
            throw $e;
        }
    }
public function refresh($entity)
    {
        try{
            return $this->entityManager->refresh($entity);
        } catch(ORMException $e) {
            if (!$this->entityManager->isOpen()) {
                $this->resetEntityManager();
            }
            throw $e;
        }
    }
Refreshes the persistent state of an entity from the database,
overriding any local changes that have not yet been persisted.

@param object $entity The entity to refresh.

@return void

@throws ORMInvalidArgumentException