-
-
Notifications
You must be signed in to change notification settings - Fork 507
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
Documents are not inserted when spl_object_hash() values collide with previously removed documents #2730
Comments
|
@GromNaN Thank you for your quick response. Do you mean I should replace each array in |
Indeed, I looked too quickly. Using |
I'm not sure how var_dump(spl_object_id(new stdClass) === spl_object_id(new stdClass)); // bool(true) |
Oh, you're right, and this will not change php/php-src#7862. All the UoW properties need to become
|
Bug Report
Summary
When trying to insert new documents after removing other documents (not necessarily from the same collection), Doctrine skips them if there is an
spl_object_hash()
collision.Current behavior
If the
spl_object_hash()
value of the new document is the same as of a removed one, Doctrine mixes them up and doesn't insert the new document.How to reproduce
At first, we populate the collection with documents that will be removed later:
Then we remove all the existing documents and create new ones. Object hash collisions should happen here; if they don't, increasing count of the documents might help.
After executing the script the collection is empty, i.e. no new documents have been inserted.
Expected behavior
All new documents are present in the database.
The text was updated successfully, but these errors were encountered: