From 95f7cc5688f1cb44850349ee82b24a2509d34d67 Mon Sep 17 00:00:00 2001 From: Dimosthenis Nikoudis Date: Thu, 23 Aug 2018 14:02:44 +0300 Subject: [PATCH 1/2] Clear the entity manager in postHandle --- Bootstraps/Symfony.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Bootstraps/Symfony.php b/Bootstraps/Symfony.php index 9206170..6945dab 100644 --- a/Bootstraps/Symfony.php +++ b/Bootstraps/Symfony.php @@ -137,6 +137,7 @@ public function postHandle($app) if (!$em->getManager()->isOpen()) { $em->resetManager(); } + $em->getManager()->clear(); } //resets stopwatch, so it can correctly calculate the execution time From 2af2c41a15df0567842f0147d3b80ff5844a7695 Mon Sep 17 00:00:00 2001 From: Dimosthenis Nikoudis Date: Fri, 24 Aug 2018 00:06:59 +0300 Subject: [PATCH 2/2] Clear the entity manager only if it was not reset --- Bootstraps/Symfony.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Bootstraps/Symfony.php b/Bootstraps/Symfony.php index 6945dab..8092a9b 100644 --- a/Bootstraps/Symfony.php +++ b/Bootstraps/Symfony.php @@ -136,8 +136,9 @@ public function postHandle($app) $em = $container->get("doctrine"); if (!$em->getManager()->isOpen()) { $em->resetManager(); + } else { + $em->getManager()->clear(); } - $em->getManager()->clear(); } //resets stopwatch, so it can correctly calculate the execution time