Browse Source

Refine optimistic locking WriteConcern wording.

Reflect the actual intent.

Closes #5126
pull/5142/head
Mark Paluch 3 weeks ago
parent
commit
f6f9978fb5
No known key found for this signature in database
GPG Key ID: 55BC6374BAA9D973
  1. 2
      src/main/antora/modules/ROOT/pages/mongodb/template-crud-operations.adoc

2
src/main/antora/modules/ROOT/pages/mongodb/template-crud-operations.adoc

@ -691,7 +691,7 @@ template.save(tmp); // throws OptimisticLockingFailureException @@ -691,7 +691,7 @@ template.save(tmp); // throws OptimisticLockingFailureException
Only certain CRUD operations on `MongoTemplate` do consider and alter version properties. Please consult `MongoOperations` java doc for detailed information.
IMPORTANT: Optimistic Locking requires to set the `WriteConcern` to `ACKNOWLEDGED`. Otherwise `OptimisticLockingFailureException` can be silently swallowed.
NOTE: Optimistic Locking requires write acknowledgement (a write result response) by the server. Using `WriteConcern.UNACKNOWLEDGED` can lead to silently swallowed `OptimisticLockingFailureException`.
NOTE: As of Version 2.2 `MongoOperations` also includes the `@Version` property when removing an entity from the database.
To remove a `Document` without version check use `MongoOperations#remove(Query,...)` instead of `MongoOperations#remove(Object)`.

Loading…
Cancel
Save