Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9165027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:49:13+00:00 2026-06-17T14:49:13+00:00

I know commands should not fail so I need to validate my command before

  • 0

I know commands should not fail so I need to validate my command before they are sent.

However, if two users are updating the same aggregate root and both appear to be valid then we would have a concurrency issue.

How do I handle this in NEventStore? Does my clients need to get a version number or commit id that they pass in on saving an event and if it has changed, then I raise an exception?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:49:14+00:00Added an answer on June 17, 2026 at 2:49 pm

    As you alluded to, one way to manage things is to specify the version you’re expecting to act on when you Load the aggregate (there’s an overload for that).

    The commit phase will then [via the Domain] yield a ConcurrencyException if your generated events clash with ones:-

    • already present [that you didn’t load into your aggregate].
    • written concurrently by competing processes

    Make sure you do >1 read of the .doc file that the NuGet package puts into your project – it covers the fundamentals of how the JO EventStore approaches the handling of this.

    UPDATE for clarity NB While this all works and is sometimes necessary, in general you’ll find [and as a default should be working hard to arrive in the happy place where] you can manage most of these conflict resolution things by making your Commands naturally idempotent in nature and/or using natural conflict resolution mechanisms in your system as a whole in order to not need to lean on your Event Store to provide such a low level guard (e.g. etags, retrying Commands in the event of a conflict etc.). If you find yourself going down this path to any major degree in practice, I’d recommend discussing your strategy with sufficient real-world use cases on the DDD-CQRS list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please let me know which commands should be used for updating the repository non
I know that a command line application should return 0 on success. But are
I would like to know how to enter commands into the cmd.exe (command prompt
Does anybody know the difference between these two commands to switch and track a
I am a very basic user and do not know much about commands used
I'm new to git; I know the basic commands, but I'm not as familiar
I know this is something i should have learned before switching to opengl es
I know that this is not the first Thread about this permission, however the
I know that it is possible to read commands output with a pipe? But
I know this is possible manually via ctrl commands using gnu screen for linux

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.