[PR #10548] Failing test: UoW unable to break cycles when removing entities without DB-level cascade #12450

Closed
opened 2026-01-22 16:14:05 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/10548

State: closed
Merged: No


This adds a failing test case for #5665.

In this example, we have a cyclic association between three entities. All associations are NULLable, so the ORM is able to perform the INSERT operation: The cycle can be broken by scheduling an "extra UPDATE" in the UoW.

However, the UoW is unable to perform the remove operation. Cyclic references by the foreign keys in the database prevent removal of two of the entities.

If the ORM were able to detect this case and perform an UPDATE before the DELETE, the test would pass – this is what the OP of #5665 asks for.

A workaround might be to use @JoinColumn(onDelete="SET NULL")].

**Original Pull Request:** https://github.com/doctrine/orm/pull/10548 **State:** closed **Merged:** No --- This adds a failing test case for #5665. In this example, we have a cyclic association between three entities. All associations are NULLable, so the ORM is able to perform the INSERT operation: The cycle can be broken by scheduling an "extra UPDATE" in the UoW. However, the UoW is unable to perform the remove operation. Cyclic references by the foreign keys in the database prevent removal of two of the entities. If the ORM were able to detect this case and perform an UPDATE _before_ the DELETE, the test would pass – this is what the OP of #5665 asks for. A workaround might be to use `@JoinColumn(onDelete="SET NULL")]`.
admin added the pull-request label 2026-01-22 16:14:05 +01:00
admin closed this issue 2026-01-22 16:14:05 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#12450