如何在连接到 Amazon RDS Oracle 实例时处理“从读取调用中获取减一”错误
我在 Amazon RDS 实例上运行 Oracle 11GR2。偶尔我会在打电话时接到一个电话,我不知道为什么。其他应用程序工作正常。IO Error: Got minus one from a read call
DriverManager.getConnection(getUrl())
为了进一步混淆事情,错误有时会自行纠正(在程序的下一次迭代之后)。
我应该如何处理“从读取调用中获得减去一”错误?
全栈跟踪:
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
数据库.java第 44 行:setConn(DriverManager.getConnection(getUrl()));
其他信息:
- 我认为这是一个糟糕的JDBC网址,但它确实有效,有时在失败之前连续几天。
- Amazon RDS 是托管实例,可能无法更改配置
- 我正在使用ojdbc6.jar进行连接