-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
Description
This issue is for the class ResetableEntityManager
// LEt assume we already have a $e1Dao (a random Dao) and a $em (entityManager)
function Foo($linkedEntity, $e1Dao, $em) {
$e1 = new E1();
$e1->addLinked($linkedEntity);
$em->persist($e1Dao);
$em->flush();
}
function Baz() {
try {
/** An operation which close the connection and force the creation of a new EntityManager (like a duplicate entry)**/
}
catch(Exception $e) {
}
}
$linkedEntity = $e1Dao->findUniqueBy(["id" => 1]);
Baz();
Foo($linkedEntity, $e1Dao, $em);
We got the following error " new entity was found through the relationship...", that mean the $linkedEntity is no longer recognized by the entityManager used at the "Flush moment" because the entityManager was recreated.
Hope this help.
Reactions are currently unavailable