连接超时。 [英] Connection timed out.

查看:62
本文介绍了连接超时。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的同事正面临着MySQL的问题。我代表他提问。


他创建了一个应用程序,他们使用MySQL作为数据库。应用程序是Java,他们使用NHibernate。


当应用程序连续运行时,数据库连接在21小时后关闭。


错误日志文件是


java.sql.SQLException:通信链接失败:java.net.SocketException,底层原因:软件导致连接中止:recv失败


**开始嵌入异常**


java.net.SocketException

消息:软件导致连接中止:recv失败


STACKTRACE:


java.net.SocketException:软件导致连接中止:recv失败



我想如果我们不查询数据库,数据库连接将在8小时后关闭...

在哪里可以改变这种行为。?

这真的是一个MySQL问题。?


问候

Dheeraj Joshi

解决方案

你的朋友必须放一个Is Connection Live吗?检查代码并重新连接,如果连接中断。


确定....所以基本上我试图找出,为什么连接超时。?


问候

Dheeraj Joshi


我不知道,但是21小时的运行时间很长。


为什么开这么久?我有很长时间的联系,但在这种情况下真的有必要吗?我想我必须假设它。


总是大约21个小时?


有很多MySQL设置,但是他们可能会或可能不会在他们的环境中访问它们。


可能是应用程序在运行一段时间后陷入困境并且对数据库没有任何活动设置超时时间 - ergo - 超时。


My colleague is facing an issue with MySQL. I am asking question on behalf of him.

He has created an application and they use MySQL as database. The application is in Java and they use NHibernate.

When the application run continuously database connection is getting closed after 21 Hours.

Error in the log file is

java.sql.SQLException: Communication link failure: java.net.SocketException, underlying cause: Software caused connection abort: recv failed

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: Software caused connection abort: recv failed

STACKTRACE:

java.net.SocketException: Software caused connection abort: recv failed

And i suppose if we don''t query the database, database connection will get closed after 8 hours...
Where to change this behavior.?

Is it really a MySQL problem.?

Regards
Dheeraj Joshi

解决方案

Your friend will have to put a "Is Connection Live?" check in the code and reconnect if the connection dies.


Ok.... So basically i am trying to find out, why the connections gets timed out.?

Regards
Dheeraj Joshi


I have no idea, but a 21 hour run is pretty long.

Why is it open so long? I have had connections open that long, but is it really necessary in this case? I guess I have to assume it is.

Is it always roughly about 21 hours?

There are a number of MySQL settings, but they may or may not have access to them in their environment.

It might be that the app bogs down after it has been running awhile and doesn''t have any activity with the database withing its set timeout period - ergo - the timeout.


这篇关于连接超时。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆