镜像数据库的连接问题

发布于 2024-07-18 18:22:46 字数 554 浏览 5 评论 0原文

设置如下:

C++ 客户端通过 OLEDB/SQL Native Client 连接到位于另一台计算机上的 SQL Server 2005 数据库。 该服务器设置了镜像(自动故障转移),同步服务器位于另一台服务器上,见证服务器位于另一台服务器上。

偶尔(每隔几天一次),我们的应用程序会卡住,因为它似乎试图建立与数据库的数据库连接,而不是简单地失败并且 OLEDB 抛出数据库连接失败,它只是“卡住”(我们有一个超时)用于连接,但永远不会超时)。 24 到 36 小时后,我们会收到一个错误:

TCP Provider: An existing connection was forcibly closed by the remote host.

事情会继续出现很多这样的错误,我们的应用最终需要重新启动。 我们无法真正弄清楚什么条件可能导致这种行为以及我们可以采取什么措施?

在初步研究中,我发现一些相关问题可以通过将 Connection Lifetime 连接字符串属性设置为非零值来解决。

有人对这里可能发生的事情有任何想法吗?

The setup is as follows:

A C++ client connects via OLEDB/SQL Native Client to a SQL Server 2005 database located on another machine. The server is setup with mirroring (automatic failover) with a synchronized server located on yet another server and a witness server on another server.

Occassionally (once every couple of days), our application seizes up in that it appears to attempt to establish a database connection to the database and rather than simply failing and OLEDB throwing a database connection failure it just gets "stuck" (we have a timeout for the connection but it's never timing out). 24 to 36 hours later we'll get an error:

TCP Provider: An existing connection was forcibly closed by the remote host.

And things will continue you on with lots of these errors and our app will eventually need to be restarted. We can't really figure out what condition could be causing this behavior and what we can do about it?

In preliminary research, I've seen some related problems that were solved by setting the Connection Lifetime connection string property to something non-zero.

Does anyone have any thoughts on what might be going on here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文