incorrect unit of work when using association class #7304

Open
opened 2026-01-22 15:49:37 +01:00 by admin · 0 comments
Owner

Originally created by @wickedOne on GitHub (Jan 28, 2024).

Bug Report

Q A
BC Break no
Version 2.17.x

Summary

the unit of work appearss "polluted" after persist -> flush -> clear -> find -> remove -> flush routine

Current behavior

when a parent class has a child collection using an association class, the unit of work contains proxy classes after removal of the entities when the entity manager is cleared in between persisting and removing. nevertheless, these entities are no longer present in the database

How to reproduce

check the code in this POC to reproduce

Expected behavior

expected behaviour would be the proxy classes not to be present in the unit of work after the second flush

Originally created by @wickedOne on GitHub (Jan 28, 2024). ### Bug Report <!-- Fill in the relevant information below to help triage your issue. --> | Q | A |------------ | ------ | BC Break | no | Version | 2.17.x #### Summary the unit of work appearss "polluted" after persist -> flush -> clear -> find -> remove -> flush routine #### Current behavior when a parent class has a child collection using an association class, the unit of work contains proxy classes after removal of the entities when the entity manager is cleared in between persisting and removing. nevertheless, these entities are no longer present in the database #### How to reproduce check the code in [this](https://github.com/wickedOne/orm/pull/1) POC to reproduce #### Expected behavior expected behaviour would be the proxy classes not to be present in the unit of work after the second flush
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7304