Closed dsibilio closed 5 years ago
/azp run
@dsibilio can you please resolve the merge conflicts for this PR. I will run additional tests to make sure we are passing everything.
@dsibilio can you please resolve the merge conflicts for this PR. I will run additional tests to make sure we are passing everything.
@kushagraThapar conflicts have been merged, ty for the reminder ;-)
@dsibilio Can you please resolve conflicts again for this PR, we would like to get it in today if possible. We would like to include this in our 2.1.8 release.
Thanks!
@dsibilio Can you please resolve conflicts again for this PR, we would like to get it in today if possible. We would like to include this in our 2.1.8 release.
Thanks!
I've merged the conflicts but couldn't run the tests. I'm having trouble with my internet connection, so if any issues occur feel free to make any amends to my branch - edits should be allowed by any spring-data-cosmosdb mantainer.
@dsibilio Can you please resolve conflicts again for this PR, we would like to get it in today if possible. We would like to include this in our 2.1.8 release. Thanks!
I've merged the conflicts but couldn't run the tests. I'm having trouble with my internet connection, so if any issues occur feel free to make any amends to my branch - edits should be allowed by any spring-data-cosmosdb mantainer.
Thanks for fixing the conflicts, I will run the CI for this branch.
/azp run
@kushagraThapar Fixed codacy issues after handling conflitcs with master, I cannot run the azure pipeline by myself due to insufficient permission. When you try and run the azp we can check if all tests are ok :)
/azp run
/azp run
Fixed a JUnit that failed due to checking wrong illegal arguments (those are downstack, checked by another test anyways). You can try again :+1:
/azp run
/azp run Emulator-spring-data-cosmosdb-tests
@dsibilio, the emulator test keeps failing, I ran it twice to make sure. Can you please fix it ?
@dsibilio, the emulator test keeps failing, I ran it twice to make sure. Can you please fix it ?
It seems the "precondition is not met" message doesn't match with the emulator's "pre-condition is not met" message. Since integration tests run, I assume the message is delivered differently if run against a real CosmosDb instance and a CosmosDb Emulator instance (?) I fixed the JUnit test assertion to just check for the "is not met" part of the error message, if you run it again we can verify further errors if any :+1:
/azp run
Fixes #378
Here you can find a basic implementation of Optimistic Locking via CosmosDB if-match precondition based on the _etag field of an entity.
Behaviour
Upserts that result in updates with not matching
_etag
s will fail. Deletes with not matching_etag
s will fail, but - as of the current implementation - deletes by Id and collection deletion do not apply any concurrency control.How-To
The
_etag
field needs to be aString
field, explicitly declared and marked with theorg.springframework.data.annotation.Version
annotation at field level, inside the entity that needs concurrency control features such as optimistic locking.E.g.
Notes