java - MongoDB Java 驱动程序 4.0+ 会重试 DBCursor.next() 吗?

标签 java mongodb mongodb-query

我知道 Mongo Java 驱动程序会重试 collection.find() ,以及大多数其他读取操作,根据 Mongo docs .
但我在文档或 driver source 中看不到任何地方- 会重试DBCursor.next()DBCursor.hasNext() ?

最佳答案

不,它不会重试基于游标的读取。

Cursor.getMore() cannot be retried because of the inability for the client to discern if the cursor was advanced. In other words, since the driver does not know if the original getMore() succeeded or not, the driver cannot reliably know if results might be inadvertently skipped.


更多细节在这里 - https://github.com/mongodb/specifications/blob/master/source/retryable-reads/retryable-reads.rst#implementing-retryable-reads

关于java - MongoDB Java 驱动程序 4.0+ 会重试 DBCursor.next() 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65257536/

相关文章:

java - 如何剪线?

node.js - Mongoose SSL,连接未被接受

MongoDb 索引已经存在

java - 如何在 Java 程序中包含 JavaScript 文件

java - 当互联网连接丢失时,优雅地处理 NPE 并在 OnPostExecute/AsyncTask 中显示 AlertDialog - Android/Java

node.js - 如何从mapReduce mongoose 中的键获取大约值?

java - 使用吗啡数据存储在 mongodb 中查询和更新

javascript - 在 mongoDB 中创建一个 firebase 样式的权限层次结构

java - 将基于 Java servlet 的应用程序从本地服务器部署到虚拟服务器上

mongodb - 在客户端暂停/恢复 MongoDB Realm 同步的解决方法或方法?