[Doctrine\\ORM\\ORMException]
The EntityManager is closed.
After I get a DBAL exception when inserting data, EntityManager closes and I\'m not
My solution.
Before doing anything check:
if (!$this->entityManager->isOpen()) {
$this->entityManager = $this->entityManager->create(
$this->entityManager->getConnection(),
$this->entityManager->getConfiguration()
);
}
All entities will be saved. But it is handy for particular class or some cases. If you have some services with injected entitymanager, it still be closed.