UnitOfWork::clear() misses $eagerLoadingEntities#7869
Conversation
|
|
|
I'm not sure why this happens either... Locally, I'm not familiar with that it only reports issues on the line(s) modified by the PR. And due to the surrounding lines, there is not much I can do to fix this. |
|
Maybe you could try aligning all equal signs, including in the surrounding lines? |
|
Let's try this! |
|
Hey! That actually worked! :) |
|
Original commit: d070fc6 |
|
The commit above contains a similar change for |
|
I have unfortunately no idea. For sure anything that contains a reference to an entity must be cleared, hence this PR, for the rest I'm not the right person to ask ;) |
|
Let's wait for feedback from contributors that know the UOW better than I do. |
|
@lcobucci Adding a test does not look like a trivial task, as there is no setter/getter for Suggestions:
|
|
Suggestion: You could use an EntityManager in a functional test to setup eagerloading entities and test the clear-method of the UOW. |
Otherwise, getClassMetadata would be triggered more times
|
Test case added |
|
@ostrolucky Thank you! |
guilhermeblanco
left a comment
There was a problem hiding this comment.
This was an issue I found when i was working on ephemeral unit of work support. It also helps on freeing resources as eager loaded entities hang there forever. Patch on its own is great.
| */ | ||
| class GH7869Test extends OrmTestCase | ||
| { | ||
| public function testDQLDeferredEagerLoad() |
There was a problem hiding this comment.
I forgot to rename test case 😞 Let me know if I Should create new PR with just this change
AFAICS, eager loading entities should be cleared as well when the UnitOfWork is cleared.
Actually, this is already the case on
master!