gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 11:18:20 29 4
gpt4 key购买 nike

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

最佳答案

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

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


更多细节在这里 - 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/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com