spring-projects / spring-projects/spring-data-mongodb

WriteResultChecking behavior

Open
#4,034 4 comments 4 reactions 1 assignee View on GitHub

@christophstrobl is already working on this.

Since May 23, 2022.

type: documentation
Dominant language
Java
Stars
1.7k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

I am a bit confused about the MongoTemplate WriteResultChecking variable: https://github.com/spring-projects/spring-data-mongodb/blob/1b7678a6af8c21e2584143ae215b18e50bcc6b7f/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java#L180
does this actively suppress write errors thrown by the MongoDB driver?
This is what the document says: https://docs.spring.io/spring-data/mongodb/docs/current/reference/html/#mongo.reactive.template.writeresultchecking

We have a large Spring Data project where we have used MongoTemplates all over the place with a majority write concern. But we haven't set this variable. I am wondering if we should now be suspicious of every write that we had ever done because Spring might have thrown away any write exceptions from the driver due to this variable not being set and the failures went silent.

Also, it looks like I am not the only one to be concerned about this. There are also these 2 questions on SO which express a similar concern:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.