3

I understand the CommitId is used internally by Jonathan Oliver's event store. So far I've always provided a Guid.NewGuid() for the CommitId.

When would you every want to do anything different?

I don't understand why it is exposed within his common domain Repository.

Can anyone can shed some light on this?

Ruben Bartelink
  • 59,778
  • 26
  • 187
  • 249
CRG
  • 677
  • 1
  • 7
  • 16
  • Good question; I can answer it (to allow competing writers who have a shared identifier such as a Command Id) to more cheaply induce fail fast idempotency behavior in the Commit process. – Ruben Bartelink May 20 '13 at 15:23
  • Thanks Ruben. For those who want to dig into this try here: http://docs.geteventstore.com/dotnet-api/3.6.0/optimistic-concurrency-and-idempotence/ – andrew pate Apr 10 '17 at 14:25

1 Answers1

3

In general, CommonDomain doesn't try to force a one-size-fits-all opinionated structure.

One way to leverage it is by having writers use their unique incoming Command Id as a CommitId - this means that competing (or retries competing with runs that have yet to time out) will get rejected with a specific exception without needing to enter into/consider/manage Conflict Resolution logic. This is used to fulfil the key tenet of Idempotent Commands.

Ruben Bartelink
  • 59,778
  • 26
  • 187
  • 249