Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostFlush event is dispatched before unitofwork is cleanup #8695

Open
alexander-schranz opened this issue May 17, 2021 · 0 comments
Open

PostFlush event is dispatched before unitofwork is cleanup #8695

alexander-schranz opened this issue May 17, 2021 · 0 comments

Comments

@alexander-schranz
Copy link
Contributor

alexander-schranz commented May 17, 2021

Currently the postflush event is dispatched before the unitofwork is cleanup. We tried to add some listener to it but got into some problems because the UnitOfWork was not yet cleanup. The code can be found here:

$this->dispatchPostFlushEvent();
$this->postCommitCleanup($entity);

$this->dispatchPostFlushEvent();
$this->postCommitCleanup($entity);

For our case it would be great if the UnitOfWork cleanup is done before dispatching the post events e.g.:

-            $this->dispatchPostFlushEvent();
+            $this->postCommitCleanup($entity);

-            $this->postCommitCleanup($entity);
+            $this->dispatchPostFlushEvent();

I understand that this could be a bc break so an alternative would be add a new postFlushCleanup event which we could listen to it. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant