microsoft / spring-data-cosmosdb

Access data with Azure Cosmos DB
MIT License
94 stars 64 forks source link

Use Optimistic lock with @Version annotation on _etag field #378

Closed ghost closed 4 years ago

ghost commented 5 years ago

Hi all, As said by #372 , how to implement the optimist lock in spring data? I have tried to use in my entity the _etag field (a cosmosdb system field updated automatically in every document changing explained in cosmos concurrency microsoft guide) with spring data @Version annotation without any result.

Incarnation-p-lee commented 5 years ago

For now, this feature is not supported, and will add to our backlog.

dsibilio commented 5 years ago

@amanganiello90, @Incarnation-p-lee: opened PR #396 for a possible implementation

ghost commented 5 years ago

I have tested it for me, and it's ok. @Incarnation-p-lee please review that and give feedbacks. Thanks

Incarnation-p-lee commented 5 years ago

@saragluna Please help to review #396 .

kushagraThapar commented 4 years ago

The feature PR has been merged and will be released in 2.1.8, and any future versions. Closing this issue.