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

Detecting Concurrent Writes #60

Open
mpluecker opened this issue Jan 27, 2017 · 1 comment
Open

Detecting Concurrent Writes #60

mpluecker opened this issue Jan 27, 2017 · 1 comment
Assignees

Comments

@mpluecker
Copy link

Since the pattern query an object -> modify -> update is not atomic, whenever updates of the same object happen simultaneously, data may be lost. This can happen because of a distributed system nature and multi-threading within a single server.
Thus, we want to detect concurrent writes, i.e. the second write request should fail. This can be accomplished by storing a revision for each entity in the database which is strictly increasing with every write access. When updating an entity, the driver then checks that the revision has not changed between querying the object and updating it.

@remi128
Copy link
Member

remi128 commented Mar 28, 2017

annotation revision marks the field to be used
usage of https://dzone.com/articles/jpa-20-concurrency-and-locking

@remi128 remi128 self-assigned this Mar 28, 2017
@remi128 remi128 added this to the pojo-mapper-1.4.0 milestone Mar 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants