Make manager registry resettable#1099
Conversation
d798dee to
be9794b
Compare
|
|
||
| public function reset() : void | ||
| { | ||
| foreach ($this->getManagerNames() as $managerName) { |
There was a problem hiding this comment.
@alcaeus My array looks like this in 1.12.3:
["default"]=>
string(35) "doctrine.orm.default_entity_manager"
and ends so with:
Doctrine ORM Manager named "doctrine.orm.default_entity_manager" does not exist.
Exception.
any hint how this can happen?
There was a problem hiding this comment.
the bin/console debug:container --parameter doctrine.entity_managers does also return it this way
|
should we force resetting the entity manager (which will unload all mapping metadata), or would clearing it be enough when it is still open (resetting is indeed necessary if the EM got closed by an error during the flush) ? |
|
Since the inclusion of this PR in the master branch I'm getting this error when running my tests: |
|
@hugochinchilla can you try the latest 1.12.x branch and report back? That should fix your issue. I’ll merge up to 2.0.x later today. |
|
@alcaeus I can confirm than cherrypicking #1108 on top o 2.0.5 fixes my issue. Also requiring I will lock to 2.0.2 until #1108 is merged on 2.0.x branch. Thanks for your help. |
|
Thanks for confirming! I've released 1.12.6 and 2.0.6 containing the fix. The reason why installing the proxy-manager-bridge works is because that makes your entity managers lazy, which avoids the exception that you ran into before. With the release, this is fixed without having lazy entity managers. |
Fixes #1083.
This also adds a dependency to the Symfony Service contracts to ensure we've got the ResettableInterface.