Skip to content

WriteResultChecking behavior #4034

Open
@sundarvenkata-EBI

Description

@sundarvenkata-EBI

I am a bit confused about the MongoTemplate WriteResultChecking variable:

private static final WriteResultChecking DEFAULT_WRITE_RESULT_CHECKING = WriteResultChecking.NONE;

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:

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions