[DoctrineORMORMException]
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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…