The EntityManager is closed

前端 未结 17 1794
星月不相逢
星月不相逢 2020-11-29 18:36
[Doctrine\\ORM\\ORMException]   
The EntityManager is closed.  

After I get a DBAL exception when inserting data, EntityManager closes and I\'m not

17条回答
  •  广开言路
    2020-11-29 18:50

    // first need to reset current manager
    $em->resetManager();
    // and then get new
    $em = $this->getContainer()->get("doctrine");
    // or in this way, depending of your environment:
    $em = $this->getDoctrine();
    

提交回复
热议问题