Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commands should be atomic #16

Open
lukaszb opened this issue Nov 5, 2016 · 0 comments
Open

commands should be atomic #16

lukaszb opened this issue Nov 5, 2016 · 0 comments

Comments

@lukaszb
Copy link
Owner

lukaszb commented Nov 5, 2016

One way we can accomplish that is to add version field to events and make unique constraint on 2 fields that identify entity at particular moment in time (entity's id and version).

There are two possible outcomes:

  1. one write would fail, leaving up to the client to decide if it want's to retry
  2. both would succeed, however this would make the client to need to re-fetch the entity to make sure it's state is in a desired shape

We are going to implement 1) approach with a custom exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant