Feature/firestore optimistic locking #188 #4279
Open
+30
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses issue #188 by adding optimistic locking support to the Firestore sample application.
Changes
@Versionannotation to theUserentity in the Firestore sample app.versionfield.equals(),hashCode(), andtoString()methods in theUserclass to include the version field for consistency.Motivation
Optimistic locking is a critical feature for handling concurrent updates in Firestore. By adding this to the sample app, we provide a clear example for users on how to prevent data overwrites using Spring Data Cloud Firestore.
Testing
./mvnw clean compile.Userentity correctly maps the version field.Fixes #188
See
also CONTRIBUTING.md
.