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

Reset event store recorded events collection before triggering post commit event #44

Merged
merged 1 commit into from
Jul 1, 2015

Conversation

dottorbabba
Copy link
Contributor

When the event store triggers the post commit event all the transaction related aspect must be closed. The collection of recorded events stored during the transaction and made persistent into the event store
must be empty.
If the listener of the "post commit" event wants to start a new transaction it have not to take care of the reset of the recorded events collection. It's not its responsibility. If the collection isn't empty the events of the new transaction will be added to the old ones and sent at the new post commit event generating a loop.
If the listener is interested into what events has been committed it can look into the event itself using the getRecordedEvents method.

commit event

When the event store triggers the post commit event all the transaction
related aspect should be closed, even the collection of recorded events
stored during the transaction and made persistent into the evento store
should be empty.
This because if the listener of the post commit event wants to start a
new transaction it should not take care of the reset ot the recorded
events collection. It's not its resposibility.
If the listener is insterested into what events has been committed it
can look into the event itself using the getRecordeEvents method.
codeliner added a commit that referenced this pull request Jul 1, 2015
Reset event store recorded events collection before triggering post commit event
@codeliner codeliner merged commit 132042b into prooph:master Jul 1, 2015
@codeliner
Copy link
Member

👍 very good catch. I totally missed that

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

Successfully merging this pull request may close these issues.

None yet

2 participants