Skip to content

Changing Multiple Streams

Charles Solar edited this page Jan 3, 2017 · 1 revision

Highly Discouraged

Aggregates.NET will warn you about changing multiple streams if it detects such behavior. This is not an error situation, but a best practice measure.

The issue at hand is if you change two streams then go to save its possible one will fail to save due to a version conflict or any other reason. Leaving you with possibly one stream committed and one failure causing the command to be retried and you potentially double-committing an event.

The persistence store GetEventStore has its own protections against this Aggregates.NET utilizes - the event id on each event is consistent no matter how many times the event is saved - so duplicate events shouldn't happen normally. But committing multiple streams at once is bad practice in general. Try to refactor your app to only save one stream per command.

Clone this wiki locally