java.sql.SQLException:Io exception:Broken pipe如何在不重新启动的情况下恢复? [英] java.sql.SQLException: Io exception: Broken pipe how to recover without restart?

查看:1092
本文介绍了java.sql.SQLException:Io exception:Broken pipe如何在不重新启动的情况下恢复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我使用连接到Oracle,当连接丢失,我尝试重新连接我收到异常:

In my application I use connection to Oracle, when connection lost and I try to re-connect I receive exception:

java.sql.SQLException: Io exception: Broken pipe
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:124)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:161)
    at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:273)
    at oracle.jdbc.driver.T4CStatement.fetch(T4CStatement.java:540)
    at oracle.jdbc.driver.OracleResultSetImpl.close_or_fetch_from_next(OracleResultSetImpl.java:264)
    at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:196)

对于recover我需要重新启动应用程序,它可能恢复而不重新启动?
感谢。

For recover I need to restart application, does it possible recover without restart? Thanks.

推荐答案

以下可能是导致异常的可能性:

Followings could be the possibilities which could be causing the exception:


  1. 网络问题:数据库和应用程序服务器之间的网络导致物理连接在一段时间后丢失。这可能是由于网络后面的防火墙配置为在指定时间段后杀死db连接。您可以考虑一种解决方法,即通过重新配置应用程序服务器来始终保持连接的活动状态。对于Tomcat,您可以尝试在Tomcat数据源配置文件(context.xml)中添加 validationQuery =select'validationQuery'from dua l

正在重置与数据库服务器的连接,并且不会通过数据库驱动程序通知客户端。在这种情况下的问题是Oracle驱动程序发现它是DBMS的套接字(防火墙您可以考虑将连接超时(在池中)设置为比解决方案的网络/数据库服务器超时时间短。

The connections to the database server are being reset and the client is not notified by the database driver. The problem in this case is that the Oracle driver is discovering that it's socket to the DBMS somehow (firewall again, maybe?) has been closed by the other end. You may consider setting your connection timeout (in the pool) shorter than the network/DB server timeout as a solution.

这篇关于java.sql.SQLException:Io exception:Broken pipe如何在不重新启动的情况下恢复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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