Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[DoctrineBridge] Don't reinit managers when they are proxied as ghost objects#46443

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

Merged
fabpot merged 1 commit intosymfony:4.4fromnicolas-grekas:manager-ghost-proxy
May 27, 2022

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedMay 24, 2022
edited
Loading

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

Paving the way to#35345

InterfaceGhostObjectInterface extendsLazyLoadingInterface but breaks LSP becausesetProxyInitializer() takes another kind of closure as argument.

This won't solve#35216 since resetting a closed entity manager won't happen anymore if we start to use ghost object proxies. But at least this code won't explode.

/cc@ostrolucky any idea what we could put inside the added "if" to solve#35216? Would you be up to submit a PR doing that, branch 6.2 I guess since that'd be a new feature?

@ostrolucky
Copy link
Contributor

I don't know, sorry.

@nicolas-grekas
Copy link
MemberAuthor

nicolas-grekas commentedMay 24, 2022
edited
Loading

OK, let's go withdoctrine/DoctrineBundle#1528 for now

@stof
Copy link
Member

To me, the best solution for that would be to implementEntityManager::reset, that would recreate a UnitOfWork and reopen the EntityManager, instead of having to replace the EntityManager instance itself. This way, an EntityManager could be reset safely in a long running process like a queue consumer, even in case an exception happens when handling one message.
This would remove the need to use a proxy for the EntityManager (which was just a hacky way of making the EntityManager compatible with such use case).

@nicolas-grekas
Copy link
MemberAuthor

What this mean@stof is that we cannot implement#35345 until ORM figured out a proper way to reset its state. Did I get you correctly?

@nicolas-grekas
Copy link
MemberAuthor

I updated the PR to throw instead of ignoring. This shouldn't happen in practice since we don't generate ghost object proxies, but let's merge as a defensive measure.

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@stofstofstof approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

5 participants

@nicolas-grekas@ostrolucky@stof@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp