How do I reset/restart a Entity Manager?
Looking at Doctrines docs:
I see that on an exception the Entity Manager closes. This is a problem for me as I have a RabbitMQ Server and the consumer(s) are always running. Durring testing we are mocking different scenarios and missing data was one of them. Well this caused and exception as it should and our Try/Catch logic worked just fine except it also closed the Entity Manager.
Reading other threads where they are having or have had the same or related issue, I've not seen a clear way to restart the EM.
Any thoughts?
Related:
Have you tried calling the resetEntityManager
method as suggested by stof?
https://github.com/doctrine/DoctrineBundle/blob/master/Registry.php#L83
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With