Safeguard for identity map seems to break merge #7174

Closed
opened 2026-01-22 15:46:04 +01:00 by admin · 3 comments
Owner

Originally created by @alexander-schranz on GitHub (Jul 6, 2023).

I'm currently running into the following issues since: https://github.com/doctrine/orm/pull/10785

Bildschirmfoto 2023-07-06 um 16 18 50

BC Break Report

Q A
BC Break yes
Version ^2@dev (current released version works)

Summary

For me it looks this currently breaks the existing EntityManager::merge method. I know merge is deprecated but it is used in this case as the object get not retriefied from the database instead unserialized and then crashes when it tries to merge into the entityManager. f977ffc0f4/src/Sulu/Bundle/AudienceTargetingBundle/Entity/TargetGroupRepository.php (L33)

Should not merged entities not show this identiy map warning as they got merged and only persisted?

Previous behavior

Don't did crash on current implemented method.

Current behavior

Crashes with a new method.

How to reproduce

git clone git@github.com:sulu/sulu.git
composer update doctrine/orm:"@dev" --prefer-source

# start database
# export DATABASE_URL=...

bin/runtests -i -t AudienceTargetingBundle -C --flags="--filter=testPut"
Originally created by @alexander-schranz on GitHub (Jul 6, 2023). I'm currently running into the following issues since: https://github.com/doctrine/orm/pull/10785 <img width="1180" alt="Bildschirmfoto 2023-07-06 um 16 18 50" src="https://github.com/doctrine/orm/assets/1698337/36f230cb-f860-4a8b-a14a-c5023a9f8dc3"> ### BC Break Report | Q | A |------------ | ------ | BC Break | yes | Version | ^2@dev (current released version works) #### Summary For me it looks this currently breaks the existing `EntityManager::merge` method. I know merge is deprecated but it is used in this case as the object get not retriefied from the database instead unserialized and then crashes when it tries to `merge` into the entityManager. https://github.com/sulu/sulu/blob/f977ffc0f480cb1d4ddee9cde0cbb8a881011d91/src/Sulu/Bundle/AudienceTargetingBundle/Entity/TargetGroupRepository.php#L33 Should not merged entities not show this identiy map warning as they got merged and only persisted? #### Previous behavior Don't did crash on current implemented method. #### Current behavior Crashes with a new method. #### How to reproduce ``` git clone git@github.com:sulu/sulu.git composer update doctrine/orm:"@dev" --prefer-source # start database # export DATABASE_URL=... bin/runtests -i -t AudienceTargetingBundle -C --flags="--filter=testPut" ```
admin closed this issue 2026-01-22 15:46:05 +01:00
Author
Owner

@mpdude commented on GitHub (Aug 2, 2023):

Can you provide an isolated test case for ORM?

To avoid regressions, we need to have that test in our own suite, we cannot run Sulu's tests in our CI.

@mpdude commented on GitHub (Aug 2, 2023): Can you provide an isolated test case for ORM? To avoid regressions, we need to have that test in our own suite, we cannot run Sulu's tests in our CI.
Author
Owner

@mpdude commented on GitHub (Aug 2, 2023):

The object you’re trying to merge (which has been serialized previously, if I get you right), is that a proxy instance?

@mpdude commented on GitHub (Aug 2, 2023): The object you’re trying to merge (which has been serialized previously, if I get you right), is that a proxy instance?
Author
Owner

@alexander-schranz commented on GitHub (Jan 29, 2024):

I tested 2.17.3 and 2.17.4 today. It seems like the issue does not longer exist also I tested https://github.com/doctrine/orm/issues/10867 which seems also be fixed there I know it was fixed in 2.16.1.

@alexander-schranz commented on GitHub (Jan 29, 2024): I tested 2.17.3 and 2.17.4 today. It seems like the issue does not longer exist also I tested https://github.com/doctrine/orm/issues/10867 which seems also be fixed there I know it was fixed in 2.16.1.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7174