最佳答案
[Doctrine\ORM\ORMException]
The EntityManager is closed.
After I get a DBAL exception when inserting data, EntityManager closes and I'm not able to reconnect it.
I tried like this but it didn't get a connection.
$this->em->close();
$this->set('doctrine.orm.entity_manager', null);
$this->set('doctrine.orm.default_entity_manager', null);
$this->get('doctrine')->resetEntityManager();
$this->em = $this->get('doctrine')->getEntityManager();
Anyone an idea how to reconnect?