Plain Java Client provide the functionality to update/delete with _etag check for optimistic locking. Spring data cosmos also provide functionality for optmistic locking in save method with _etag check. Is there a provision for the same in delete document through _etag check in spring data cosmos.
Asked
Active
Viewed 335 times
1 Answers
0
Yes, the delete method will work only with the @Version String _etag
annotation. Please see the Spring Data Cosmos SDK for more specific information.
- Supports Optimistic Locking for specific containers, which means upserts/deletes by document will fail with an exception in case the document was modified by another process in the meanwhile. To enable Optimistic Locking for a container, just create a string _etag field and mark it with the @Version annotation. See the following example:
Please let me know if you have any additional questions.

Mike Ubezzi
- 1,007
- 6
- 8