spring-projects / spring-projects/spring-data-mongodb
WriteResultChecking behavior
@christophstrobl is already working on this.
Since May 23, 2022.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.