title: How to approach a "Got minus one from a read call" error when connecting to an Amazon RDS Oracle instance
body: <p>I'm running Oracle 11GR2 on an Amazon RDS instance. occasionally I get an <code>IO Error: Got minus one from a read call</code> when making a call to <code>DriverManager.getConnection(getUrl())</code> and I'm not sure why. Other applications work correctly. </p>
  
  <p>To further confuse things, the error will correct itself on occasion (following next iteration of the program). </p>
  
  <p><strong>How should I approach a "Got minus one from a read call" error?</strong></p>
  
  <p>Full stack trace: </p>
  
  <pre><code>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.&lt;init&gt;(PhysicalConnection.java:553)
      at oracle.jdbc.driver.T4CConnection.&lt;init&gt;(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.&lt;init&gt;(Database.java:44)
      at com.cwd.facile.ns.NetSuiteRequestBased.&lt;init&gt;(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
  </code></pre>
  
  <p>Database.java line 44: <code>setConn(DriverManager.getConnection(getUrl()));</code></p>
  
  <p>Other info: </p>
  
  <ul>
  <li>I thought it was a bad JDBC url, but it does work, sometimes for days on end before failing. </li>
  <li>Amazon RDS is a managed instance and configuration changes may not be possible</li>
  <li>I am using ojdbc6.jar for connectivity  </li>
  </ul>