Optimistic locking should be enforceable at the framework level [DATAES-674] #1248
Labels
status: declined
A suggestion or change that we don't feel we should currently apply
type: enhancement
A general enhancement
danielsonjh opened DATAES-674 and commented
When using
@Version
, the field type needs to be Long.When the version field is null, spring-data-elasticsearch does not set the version query param in the request to Elasticsearch.
If it's critical to enforce the usage of optimistic locking, currently the best option seems to be to validate / set the version field in the domain object.
It would be convenient if there was an option to either throw an exception for missing versions, or default the version field / query param to 0 at the framework level to make the policy easier to enforce
No further details from DATAES-674
The text was updated successfully, but these errors were encountered: