gpt4 book ai didi

mongodb - 如何处理 MongoDB 中的过时连接

转载 作者:可可西里 更新时间:2023-11-01 10:34:41 28 4
gpt4 key购买 nike

在 Mongo 中自动刷新过时连接的最佳方法是什么?

回收 mongod 服务后,我从我的 Liferay Portlets 中得到这个异常:

com.mongodb.MongoException$Network: can't call something : /127.0.0.1:27017/connection_test

最佳答案

您的代码中需要有“处理异常和重试逻辑”。这可能会有所帮助:Exceptions, and how best to retry when a connection is reset?

关于mongodb - 如何处理 MongoDB 中的过时连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10432145/

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