title: Io exception: End of TNS data channel
body: <p>I am using the oracle 11g and java. I am using the withinCostPolygon api for find the points of the polygon.But I got an exception on some points(lat and lon) and cost. The exception is </p>
  
  <pre><code>[oracle.spatial.network.lod.util.JGeometryUtility, ERROR] java.sql.SQLException: Io exception: End of TNS data channel
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
      at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:255)
      at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:973)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1160)
      at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
      at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3390)
      at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4223)
      at oracle.spatial.network.lod.util.JGeometryUtility.concaveHull(JGeometryUtility.java:685)
      at oracle.spatial.network.lod.NetworkAnalyst.withinCostPolygonUsingNetworkBuffer(NetworkAnalyst.java:1550)
      at oracle.spatial.network.lod.NetworkAnalyst.withinCostPolygonInternal(NetworkAnalyst.java:1318)
      at oracle.spatial.network.lod.NetworkAnalyst.withinCostPolygonInternal(NetworkAnalyst.java:1286)
      at oracle.spatial.network.lod.NetworkAnalyst.withinCostPolygon(NetworkAnalyst.java:1262)
      at oracle.spatial.network.lod.NetworkAnalyst.withinCostPolygon(NetworkAnalyst.java:1244)
      at TestDriveTimePolygon.main(TestDriveTimePolygon.java:161) 
  </code></pre>
  
  <p>TestDriveTimePolygon.java is my java code </p>
  
  <p>I found the linkid and percentage through a procedure by passing the lat and lon of the point. </p>
  
  <pre><code> PointOnNet startPoint = new PointOnNet(linkId, percentage);
  
  
                          PointOnNet[] startPoints = {startPoint};
                          JGeometry resultPolygon;
                          double costThreshold = 0.1;  //in km 
                          System.out.println("costThreshold:" + costThreshold);
  
                          System.out.println("before resultPolygon");
  
                          resultPolygon = analyst.withinCostPolygon(startPoints,
                                                         costThreshold, null, null);
                          System.out.println("aftr rsltplgon");
                          resultPolygon.setSRID(8307); // set SRID
                          resultPolygon.setType(resultPolygon.GTYPE_POLYGON); 
  </code></pre>
  
  <p>when debugging the exception came at the line of withincostpolygon.</p>
  
  <p>and this is not came in all Lat and Lon and cost.</p>
  
  <p>why these exception occurred?
  My another question is why not  these exception catches by sqlexception?( I added the try and catch)</p>
  
  <pre><code>  catch(IOException iex)
                      {
                          System.out.println("IO Exception ERROR");
                          iex.printStackTrace();
                      }
                      catch(NetworkDataException ndEx)
                      {   
                          System.out.println("NetworkDataException ERROR");
                          ndEx.printStackTrace();
                      }
                      catch(SQLException sqlEx)
                      {
                          System.out.println("sqlEx ERROR");
                          sqlEx.printStackTrace();
                      } 
                      catch (LODNetworkException e) 
                      {
                          System.out.println("LOD ERROR");
                          //throw e;
                          //e.printStackTrace();
                          System.out.println("LOD ERROR: Invalid cost");
                          System.out.println("LOD ERROR");
  
                      }
                      catch (Exception e) 
                      {
                          System.out.println("Exception ERROR");
                          e.printStackTrace();
                      }
  </code></pre>