Avoiding UniqueConstraintViolationException due to Doctrine commit order
The problem Doctrine has a well defined internal order for the persist operations it executes during a flush. It’s called “commit order” and it’s the following: all entity inserts (topological order) all entity updates (topological order) all collection deletions all…