Could not persist aggregate. I've read all the various issues around this and still have questions... #360
Unanswered
SimonMacIntyre
asked this question in
Q&A
Replies: 2 comments 1 reply
-
I have gathered that it is not standard practice to apply events inside an aggregate method which is itself triggered by another event. I guess I have run into a pitfall, I thought that would be acceptable but I guess I was misusing aggregates in a way they were not designed for. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Create a reactor to handle a side effect. Example:
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, first, please forgive me for opening yet another question on this subject, I know there are many. The majority of which point to #214 as some help, but I am still left wanting to understand, as well as not satisfied really with those responses. I do not want to enable concurrency.
Consider these 2 events.

The
id
column has the correct order, and you can see the incorrect swap on theaggregate_version
column. However, I'm very confused about how this is possible given my setup.See, this is the pseudocode of what is causing this:
The point is, I am:
synchronously
because I have not enabled concurrency, and as well my setting of:'dispatch_events_from_aggregate_roots' => false,
in the config.id
) column is correct, how in the world is theaggregate_version
being swapped?Am I making a mistake in my implementation here? All I want to do is have B consistently happen after A. I am recording the event myself so I'm at a loss to how B in the example above could have its
aggregate_version
end up being a smaller number than event A.Hopefully this explained my issue clearly. I do not want to
enable concurrency
, these are supposed to be synchronous, and I thought thatfiring A
andonEventA do EventB
would always be A->B. Am I missing something here?Thanks in advance for your time and for this great open source package! 🙏
Beta Was this translation helpful? Give feedback.
All reactions