[End of TNS data channel] with Java SDO API (JDBC thin 9.0.1.2.1)
gkk1969Nov 8 2002 — edited Feb 15 2005Hello folks,
Environment:
Win2K, 1.2GHz Intel, 500MB RAM, Oracle 9i, Oracle JDBC Thin (9.0.1.2.1), JDK1.3
Our data in the DB is 2-D. It consists of SDO LineString geometries. We use SRID = 8307.
I run into this problem with Java SDO API. I got this exception: "Io exception: End of TNS data channel"
when I try to execute query that uses the SDO_RELATE function:
SELECT e.shape
FROM edge e
WHERE SDO_RELATE(e.shape,
mdsys.sdo_geometry( 2003, 8307, NULL,
mdsys.sdo_elem_info_array(1,1003,1),
mdsys.sdo_ordinate_array(-125.8,49.9,-125.6,49.9,-125.6,50.0,-125.8,50.0,-125.8,49.9) ),
'mask=ANYINTERACT querytype=WINDOW') = 'TRUE'
If I use SDO_FILTER instead of SDO_RELATE it works!
Here is how I execute the query in Java:
public int executeSpatialQuery(OracleConnection conn, String spatialQuery) throws Exception
{
int numberOfGeometries = 0;
conn.setDefaultRowPrefetch(1000);
Statement ps = conn.createStatement();
ResultSet rs = ps.executeQuery(spatialQuery);
while (rs.next()) {
numberOfGeometries++;
}
rs.close();
ps.close();
return numberOfGeometries;
}
Note: I was playing with the "conn.setDefaultRowPrefetch(n)" method hoping that there might be something to do with that but with no success.
Any help will be much appreciated. Thank you.
GKK