Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DoctrineBridge] Add check for lazy object interface#53079
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
In Symfony 6.4 lazy loading of ghostproxies is the default.This means if using 6.4 componentswith the 5.4 version of the doctrinebridge you get the following errorwhen trying to reset the entity manager:```Resetting a non-lazy manager service is not supported.Declare the "doctrine.orm.default_entity_manager" service as lazy.```The entity manager is set as lazyalready in our case but it extends `\Symfony\Component\VarExporter\LazyObjectInterface`instead of the `LazyLoadingInterface`
Uh oh!
There was an error while loading.Please reload this page.
nicolas-grekas left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Works for me. This is special case because we made flex allow recent VarExporter to be combined with 5.4 apps to make it easier to upgrade to latest versions of Doctrine.
maxbaldanza commentedDec 19, 2023
Thanks@nicolas-grekas 🙌 |
fabpot commentedDec 19, 2023
Thank you@maxbaldanza. |
Uh oh!
There was an error while loading.Please reload this page.
In Symfony 6.4 lazy loading of ghost proxies is used out of the box.
This means if using 6.4 components with the 5.4 version of the doctrine
bridge you get the following error when trying to reset the entity manager:
The entity manager is set as lazy
already in our case but it extends
\Symfony\Component\VarExporter\LazyObjectInterfaceinstead of theLazyLoadingInterfacethat's expected