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
Currently, the method Aggregate.apply(List<Event> events) always adds all events to the in-memory list of aggregate's uncommittedEvents, ignoring the actual result of applying them to the entity.
When multiple messages are dispatched in a batch, the entities may be cached. In this situation, if the earlier dispatch produces events which render aggregate state invalid, but the following one is successful, all of the events will be actually saved to the storage, forever corrupting the aggregate history.
The text was updated successfully, but these errors were encountered:
dmitrykuzmin
changed the title
Add events to the list of uncommitted in Aggregate only if they are successfully applied to entity
Add events to the list of uncommitted in Aggregate only if they are successfully applied to the entity
Oct 21, 2020
Currently, the method
Aggregate.apply(List<Event> events)
always adds allevents
to the in-memory list of aggregate'suncommittedEvents
, ignoring the actual result of applying them to the entity.When multiple messages are dispatched in a batch, the entities may be cached. In this situation, if the earlier dispatch produces events which render aggregate state invalid, but the following one is successful, all of the events will be actually saved to the storage, forever corrupting the aggregate history.
The text was updated successfully, but these errors were encountered: