You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Normally this is kind of splitted up in several services:
Controller
which calls a sync Message via symfony messenger
a MessageHandler which does load the entity do the changes and use a custom eventCollector service to add events which dispatcher after entity was saved
a Middleware which does the flush
a postFLush listener which dispatched the collected events
a EventListener which may edit / update other entities and call so flush again
I did avoid this complexity and put the parts into the TestConroller
The text was updated successfully, but these errors were encountered:
Bug Report
Summary
Collection clear UnitOfWork calls DELETE query again on event listener in postFlush and so loses relations.
Current behavior
It seems like the postFlush event the UnitOfWork is not correctly cleaned up and the
DELETE
query is trigger again.Expected behavior
DELETE query should only triggered once and not again in additional flush.
How to reproduce
I created a reproducer repository here: https://github.com/alexander-schranz/doctrine-unit-of-work-flush-clear-reproducer
The important file is this one:
https://github.com/alexander-schranz/doctrine-unit-of-work-flush-clear-reproducer/blob/main/src/Controller/TestController.php
Normally this is kind of splitted up in several services:
Controller
Message
via symfony messengerMessageHandler
which does load the entity do the changes and use a customeventCollector
service to add events which dispatcher after entity was savedMiddleware
which does the flushI did avoid this complexity and put the parts into the TestConroller
The text was updated successfully, but these errors were encountered: