Skip to content

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.

2 participants