Skip to content

DoctrineBusMessageListener may cause double flush depending if message is not async #309

Description

@mpoiriert

There is a possible flow that cause issue, if a message is dispatch and not async, in the handler it's flushing that will cause a double flush.

I had an entity that was refering another entity, the double flush cause a "A new entity was found through the relationship...".

Work around is to put a cascade "remove" but the entity was suppose to be one sided.

Solution would be to decorate the unit of work to dispatch an specific event at the end (after the postCommitCleanup) so it will not be a "double flush" since nothing will be done after it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions