Windows 中 JDBC-MySQL 的命名管道与 TCP

发布于 2024-07-17 23:04:16 字数 368 浏览 3 评论 0原文

我的 Java (JPA+Hibernate+CommonsDBCP) 应用程序连接到 MySQL 时遇到了许多连接问题。 我已经完成了研究,调整了所有设置,包括验证查询、超时、X 之前的测试等。

这条路径让我想到了另一个比较 DBCP 和 C3PO 的 StackOverflow 问题。 从回复中,我决定一定要尝试 C3PO。

然而,在此过程中,我发现了另一个选择:命名管道,因为应用程序服务器和 MySQL 都在同一台计算机上运行。 问题是,我找不到有关此方法的很多详细信息。

所以这是我的问题:什么是最稳定的选项:命名管道,还是 TCP w/C3PO? 任何故事或知识以及答案都将受到欢迎

I've been having numerous connection problems between my Java (JPA+Hibernate+CommonsDBCP) app connecting to MySQL. I've done the research, tweaked all the settings with validation queries, timeouts, tests before X, etc.

This path led me to another StackOverflow question comparing DBCP and C3PO. From the responses, I've decided to definitely try out C3PO instead.

Along the way, however, I've found another option: named pipes, since both the app server and MySQL are running on the same machine. Trouble is, I can't find many details about this method.

So here's my question: what is going to be the most STABLE option: Named pipes, or TCP w/C3PO? Any stories or knowledge would be most welcome as well as answers.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忱杏 2024-07-24 23:04:16

好吧,这取决于你的情况:

谁在连接 MySQL? 来自慢速 LAN 或 WAN 链路的客户端? 还是本地主机?

TCP/IP 具有连接积压的优点,而命名管道却没有,因此对于慢速链接或 WAN,我会选择 TCP/IP; 否则,命名管道。

此外,本地命名管道在内核模式下运行,因此速度会非常快。

尝试查看 http://msdn.microsoft.com/ en-us/library/aa178138(SQL.80).aspx

尽管它涉及 MS SQL Server,但在内核模式下运行的本地命名管道应该仍然适用。

Well, it depends on your situation:

Who is connecting to MySQL? Clients from a slow LAN or WAN link? Or localhost?

TCP/IP has the benefit of connection backlogging, where named pipes do not, so for slow links or WAN, I would go with TCP/IP; otherwise, named pipes.

Also, local named pipes run in kernel mode so they're going to be pretty fast.

Try looking at http://msdn.microsoft.com/en-us/library/aa178138(SQL.80).aspx

Even though it speaks about MS SQL Server, the Local named pipes running in kernel mode should still apply.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文