Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag Doctrine's EntityManager with ResetInterface #34720

Closed
Aerendir opened this issue Nov 29, 2019 · 8 comments
Closed

Tag Doctrine's EntityManager with ResetInterface #34720

Aerendir opened this issue Nov 29, 2019 · 8 comments

Comments

@Aerendir
Copy link
Contributor

Description
Following this discussion on Twitter with @lyrixx and @nicolas-grekas , I'm opening this issue.

It seems that the Doctrine's EntityManagers are not tagged with the ResetInterface interface and so they are not reset when calling Application::reset() method.

Currently I've not verified on my own, but I trust what @lyrixx said in the Twitter 3d.

@xabbuh
Copy link
Member

xabbuh commented Nov 30, 2019

Can you open the issue in the DoctrineBundle repository? That's where the service for the entity manager is defined.

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Nov 30, 2019

Actually we do reset the entity managers, it's the job of ManagerRegistry, see https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Doctrine/ManagerRegistry.php

This works only when ocramius/proxy-manager is installed - for some reasons I don't recall - but they must be serious (please prove me wrong :) )

@Aerendir
Copy link
Contributor Author

So, in the end, the answer is "Yes, the EntityManager is reset when calling Application::rest()"?

@nicolas-grekas
Copy link
Member

It's a bit more subtle but yes, the answer is yes :)

@Aerendir
Copy link
Contributor Author

Aerendir commented Dec 1, 2019

What do you mean by “a bit more subtle”?🤔

@nicolas-grekas
Copy link
Member

@Aerendir what I wrote above :)

This works only when ocramius/proxy-manager is installed

@nicolas-grekas
Copy link
Member

On a closer look, while the code infrastructure is there, it looks like it's not wired by default.
I opened doctrine/DoctrineBundle#1083 as a follow up.

@alcaeus
Copy link
Contributor

alcaeus commented Dec 18, 2019

A fix has been released in DoctrineBundle 1.12.4 and 2.0.4. Thanks for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants