mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
UniqueConstraintViolationException throwed when calling clear() on a collection owned by an entity with DEFERRED_EXPLICIT change tracking policy #6441
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mmonsang on GitHub (Apr 2, 2020).
BUG report
Summary
Since version 2.6.4, and the resolution of #7758 :
Calling clear() on a Many-to-many association collection owned by an entity with DEFERRED_EXPLICIT change tracking policy could provoke UniqueConstraintViolationException.
How to reproduce
Mapping :
with PHP code :
Result
throw a
PDOException\PDOException\UniqueConstraintViolationExceptionExpected behavior
No exception should be throwed.