我之前也发布过这个问题,我再次发布它,因为它还没有解决。
我在我的应用程序中使用 Symfony2,我需要创建两个数据库连接,即读取和写入,我搜索并轻松发现我们可以创建不同的实体管理器,我已经创建了这样的:
在控制器中制作对象
$emWrite = $this->getDoctrine()->getEntityManager('write');
$em = $this->getDoctrine()->getEntityManager();
当我坚持实体时,它给了我以下错误:
A new entity was found through the relationship '
AppBundle\Entity\Follower#user' that was not configured to cascade persist
operations for entity: adeel. Explicitly persist the new entity or configure
cascading persist operations on the relationship. If you cannot find out which
entity causes the problem implement AppBundle\Entity\User#__toString()
to get a clue. (500 Internal Server Error)
我已经尝试过很多事情,比如在所涉及的实体的双方都提供持久属性。