In spring data to execute with in same connection, you should use mongoTemplate.executeInSession(DbCallback action)
. Please take a look at the Spring documentation Section 5.1.1 about Execution Callback.
Does spring data handle “consistent request” for mongo db?
-
01-07-2022 - |
Question
Here consistent request in Mongo I found how to handle consistent request in java code.
DB db...;
db.requestStart();
try {
db.requestEnsureConnection();
code....
} finally {
db.requestDone();
}
Does spring-data cares about it. Or I should do it manually as using plain java driver?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow