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

Optimistic locking #588

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open

Optimistic locking #588

wants to merge 30 commits into from

Conversation

cur3n4
Copy link
Collaborator

@cur3n4 cur3n4 commented Nov 2, 2016

Rough attempt at implementing optimistic locking.

@neumino
Copy link
Owner

neumino commented Nov 7, 2016

Sounds reasonable to me, the current implementation seems to be working. I would have two little questions:

  • Can we find a better name than optimisticLocking?
  • How does this field version plays with the schema? I guess you have to declare it like type.number()?

@cur3n4
Copy link
Collaborator Author

cur3n4 commented Nov 7, 2016

  • How about the name version? This is the standard in the JAVA world.
  • My suggestion would be to support different types and the type defines the way to generate the next version value . type.number() will behave as an auto increment field, type.string() as an uuid and type.date() as a timestamp.

I'll prepare a proper PR.

@cur3n4
Copy link
Collaborator Author

cur3n4 commented Mar 1, 2017

Sorry for the delay, I have updated the PR.
Renamed configuration option to version. I have included support for columns of type Date and Number . Strings are doable also but will require either adding support to generate UUID or use r.uuid().
Please let me know your thoughts.

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

Successfully merging this pull request may close these issues.

None yet

2 participants