如何接近“从读取呼叫中减去一个”连接到Amazon RDS Oracle实例时出错 [英] How to approach a "Got minus one from a read call" error when connecting to an Amazon RDS Oracle instance

查看:334
本文介绍了如何接近“从读取呼叫中减去一个”连接到Amazon RDS Oracle实例时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Amazon RDS实例上运行Oracle 11GR2。偶尔我得到一个 IO错误:在调用 DriverManager.getConnection(getUrl())减去一个$ c>我不知道为什么。其他应用程序正常工作

I'm running Oracle 11GR2 on an Amazon RDS instance. occasionally I get an IO Error: Got minus one from a read call when making a call to DriverManager.getConnection(getUrl()) and I'm not sure why. Other applications work correctly.

为了进一步混淆事情,错误会偶尔纠正(在程序的下一次迭代之后)。

To further confuse things, the error will correct itself on occasion (following next iteration of the program).

我应该如何处理从阅读电话中减去一个错误?

完整堆栈跟踪:

java.sql.SQLRecoverableException: IO Error: Got minus one from a read call
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:489)
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:553)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:254)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:528)
    at java.sql.DriverManager.getConnection(DriverManager.java:579)
    at java.sql.DriverManager.getConnection(DriverManager.java:243)
    at com.cwd.facile.db.Database.<init>(Database.java:44)
    at com.cwd.facile.ns.NetSuiteRequestBased.<init>(NetSuiteRequestBased.java:29)
    at com.cwd.facile.ns.CommonOperations.isInventoryItem(CommonOperations.java:205)
    at com.cwd.facile.ns.CommonOperations.findItemIdByName(CommonOperations.java:188)
    at com.cwd.facile.ns.CommonOperations.createSalesOrder(CommonOperations.java:970)
    at com.cwd.facile.Main.main(Main.java:47)
Caused by: oracle.net.ns.NetException: Got minus one from a read call
    at oracle.net.ns.Packet.receive(Packet.java:311)
    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:300)
    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1140)
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:340)
    ... 12 more

Database.java第44行: setConn(DriverManager.getConnection(getUrl()));

Database.java line 44: setConn(DriverManager.getConnection(getUrl()));

其他信息:


  • 我认为这是一个糟糕的JDBC网址,但它确实有效,有时连续几天才会失败。

  • Amazon RDS是托管实例,可能无法更改配置

  • 我使用ojdbc6.jar进行连接

推荐答案

问题的直接原因是JDBC驱动程序试图从已关闭的网络Socket中读取另一端。

The immediate cause of the problem is that the JDBC driver has attempted to read from a network Socket that has been closed by "the other end".

这可能是由于以下几点:

This could be due to a few things:


  • 如果远程服务器已配置(例如在SQLNET.ora文件中),则不接受来自IP的连接。

  • If the remote server has been configured (e.g. in the "SQLNET.ora" file) to not accept connections from your IP.

如果JDBC url不正确,您可能正在尝试连接到非数据库的东西。

If the JDBC url is incorrect, you could be attempting to connect to something that isn't a database.

如果有太多的数据库服务打开连接,它可以拒绝新的连接。

If there are too many open connections to the database service, it could refuse new connections.

鉴于症状,我认为太多连接的情况是最多的有可能。这表明您的应用程序正在泄漏连接;即创建连接,然后无法(始终)关闭它们。

Given the symptoms, I think the "too many connections" scenario is the most likely. That suggests that your application is leaking connections; i.e. creating connections and then failing to (always) close them.

这篇关于如何接近“从读取呼叫中减去一个”连接到Amazon RDS Oracle实例时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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