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

DDC-2332: Ensure managed entities are always tracked by UOW #8994

Closed
wants to merge 3 commits into from

Conversation

bigfoot90
Copy link

This is a rebase of MR #7407 on 2.9.x branch.
Fixes #3037

@bigfoot90 bigfoot90 force-pushed the 3037 branch 2 times, most recently from 47c1b24 to 5f50737 Compare September 9, 2021 15:56
lib/Doctrine/ORM/UnitOfWork.php Outdated Show resolved Hide resolved
lib/Doctrine/ORM/UnitOfWork.php Outdated Show resolved Hide resolved
tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php Outdated Show resolved Hide resolved
tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php Outdated Show resolved Hide resolved
tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php Outdated Show resolved Hide resolved
@greg0ire
Copy link
Member

vendor/bin/phpcbf can help with the CS issues

@bigfoot90
Copy link
Author

Thanks, fixed all cs

@bigfoot90
Copy link
Author

@greg0ire Friendly ping

@qkdreyer
Copy link

Any updates on this ?

@derrabus derrabus changed the base branch from 2.9.x to 2.10.x December 26, 2021 00:35
@bigfoot90
Copy link
Author

Rebased on 2.10.x

@beberlei
Copy link
Member

beberlei commented Jan 6, 2022

I am skeptical. Can you explain the test a little better via comments? Its doing s lot, not sure where exactly and what fails. Is the merge necessary to cause this?

@bigfoot90 bigfoot90 force-pushed the 3037 branch 2 times, most recently from 481e12e to 97f9e26 Compare January 13, 2022 00:22
@bigfoot90
Copy link
Author

Rebased on 2.10.x again and added some comments on test as suggested.

This same test testObjectIdCollision copy-pasted on branch 2.10.x is failing on iteration 60, but your could be different.

@derrabus derrabus changed the base branch from 2.10.x to 2.11.x January 13, 2022 08:35
@flack
Copy link
Contributor

flack commented Jun 23, 2022

just in case it helps: A long time ago, I also made a failing test case for this issue: #843. Not sure if it is more understandable, but just wanted to mention it if someone is looking for a different approach

@@ -1541,6 +1551,8 @@ public function addToIdentityMap($entity)
$idHash = implode(' ', $identifier);
$className = $classMetadata->rootEntityName;

$this->oidMap[$oid] = $entity;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of saving the whole document, just save a reference to it. This will also stop it from being garbage collected and uses much less memory

$this->oidMap[$oid] = &$entity;

@mpdude
Copy link
Contributor

mpdude commented Jun 23, 2023

@bigfoot90 maybe you want to join #10791

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

Successfully merging this pull request may close these issues.

DDC-2332: [UnitOfWork::doPersist()] The spl_object_hash() generate not unique hash!
9 participants