Java.sql.SQLException: Io exception: End of TNS data channel

Hello folks,
Has amyone encountered this exception? If so, could you please shed some light for what might be going wrong?
Here is my confuguration:
400MB RAM
1.2GHTz processor
Win2K Pro
Oracle server 9.0.1
JDBC Thin driver (libs for 9.0.1)
Scenario:
My Java code uses Oracle Spatial to insert SDO_GEOMETRY objects into my DB model.
I have a config file where I store my connection properties, e.g.,
<DBConnection name="twatest">
<JDBCDriver>oracle.jdbc.driver.OracleDriver</JDBCDriver>
<URL>jdbc:oracle:thin:@saturn:1521:saturn</URL>
<Username>user1</Username>
<Password>twatest</Password>
</DBConnection>
We have 2 schemas defined: user1 and twatest.
The problem first occured when I switched from user1 to twatest. Consequent attempt to run the process as user user1 failed! The Java SQL statements do not use schemas (so they default, I suppose, to the default schema for that particular user, in our case being user1-->user1, twatest-->twatest).
The problem happens in the following Java class (search for "HERE" to see where exactly the problem occurs):
package com.vividsolutions.twatest;
import java.util.*;
import java.sql.*;
import oracle.sql.*;
import oracle.sdoapi.OraSpatialManager;
import oracle.sdoapi.geom.*;
import oracle.sdoapi.adapter.*;
import oracle.sdoapi.sref.*;
import com.vividsolutions.twatest.parser.*;
import com.vividsolutions.twatest.config.*;
import com.vividsolutions.twatest.model.*;
* This class is responsible for loading lakes into the SDO Oracle Spatial DB.
public class LakeLoader
static boolean initialized = false;
private static GeometryFactory gF;
private static SRManager srManager;
private static SpatialReference sref;
private static GeometryAdapter sdoAdapter;
public static void loadLake(EdgedLake slake, Connection conn) throws Exception {
com.vividsolutions.jts.geom.Envelope e = slake.getEnvelope();
if (e == null) {
System.out.println("Invalid envilope (feature ID="+slake.getFeatureId()+")! Ignoring...");
return; // ignore lake - it's invalid (no envilope)
if (!initialized) {
initialize(conn);
initialized = true;
Geometry geom;
STRUCT str;
// insert Lake
String lakeQuery = "INSERT INTO lake " +
"(lake_id, area, bounding_box, name, instantiation_date) " +
"VALUES(?,?,?,?,?)";
PreparedStatement ps = conn.prepareStatement(lakeQuery);
int lakeId = getId(Lake.ID, conn);
ps.setInt(1, lakeId);
ps.setDouble(2, Double.parseDouble(slake.getArea()));
// Creates a 2-D rectangle (special case of Polygon geometry).
geom = gF.createRectangle(e.getMinX(), e.getMinY(), e.getMaxX(), e.getMaxY());
ps.setObject(3, sdoAdapter.exportGeometry(STRUCT.class, geom));
ps.setString(4, slake.getName());
ps.setTimestamp(5, new Timestamp(new java.util.Date().getTime()));
ps.executeUpdate(); // <-- HERE I got: java.sql.SQLException: Io exception: End of TNS data channel
//ps.close();
String ringQuery = null;
int ringId = 0;
List shellEdges = slake.getShellEdges();
if (shellEdges != null && shellEdges.size() > 0) { // if there is valid shell, insert it...
// insert shell Rings
ringQuery = "INSERT INTO ring (ring_id, lake_id, type) VALUES(?,?,?)";
ps = conn.prepareStatement(ringQuery);
ringId = getId(Ring.ID, conn);
ps.setInt(1, ringId);
ps.setInt(2, lakeId);
ps.setString(3, Ring.SHELL);
ps.executeUpdate();
//ps.close();
// insert shell ring Edges
insertEdges(shellEdges, lakeId, Ring.SHELL, ringId, conn);
List holeEdges = slake.getHoleEdges();
if (holeEdges != null && holeEdges.size() > 0) { // if there are valid holes, insert them...
// insert hole Rings
ringQuery = "INSERT INTO ring (ring_id, lake_id, type) VALUES(?,?,?)";
ps = conn.prepareStatement(ringQuery);
ringId = getId(Ring.ID, conn);
ps.setInt(1, ringId);
ps.setInt(2, lakeId);
ps.setString(3, Ring.HOLE);
ps.executeUpdate();
//ps.close();
// insert hole ring Edges
insertEdges(holeEdges, lakeId, Ring.HOLE, ringId, conn);
ps.close();
private static void insertEdges(List edges, int lakeId, String ringType,
int ringId, Connection conn) throws Exception {
if (!initialized) {
initialize(conn);
initialized = true;
Geometry geom;
STRUCT str;
// insert shell ring Edges
String edgeQuery = "INSERT INTO edge " +
"(edge_id, lake_id, ring_type, ring_id, edge_sequence, shape) " +
"VALUES(?,?,?,?,?,?)";
int edge_sequence = 0;
for (Iterator it=edges.iterator(); it.hasNext(); ) {
Edge edge = (Edge)it.next();
geom = gF.createLineString(LakeFactory.edgeToArray2D(edge)); // 2-dimensional coordinates
PreparedStatement ps = conn.prepareStatement(edgeQuery);
int edgeId = getId(Edge.ID, conn);
ps.setInt(1, edgeId);
ps.setInt(2, lakeId);
ps.setString(3, ringType);
ps.setInt(4, ringId);
ps.setInt(5, edge_sequence++);
ps.setObject(6, sdoAdapter.exportGeometry(STRUCT.class, geom));
ps.executeUpdate();
ps.close();
* @param key This can be: "lake", "ring", or "edge".
* @param conn The connection to use.
* @return the unique ID corresponding to the given key.
public static int getId(String key, Connection conn) {
int id = -1;
try {
String query = "SELECT "+key+"_SEQUENCE.NEXTVAL FROM DUAL";
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(query);
while (rs.next()) {
id = rs.getInt(1);
stmt.close();
} catch(SQLException sqle) {
sqle.printStackTrace();
return id;
private static void initialize(Connection conn) throws Exception {
gF = OraSpatialManager.getGeometryFactory();
// Set spatial reference system in which the geometries will be created
srManager = OraSpatialManager.getSpatialReferenceManager(conn);
sref = srManager.retrieve(8307);
gF.setSpatialReference(sref);
sdoAdapter = OraSpatialManager.getGeometryAdapter("SDO", "8.1.6",
null, STRUCT.class, null, conn);
public static void main(String args[]) throws Exception
String[] xmlLakeFiles = {
"lakes101to1400.xml",
"lakes1401to10000.xml",
"lakes10001to20000.xml",
"lakes20001to30000.xml",
"lakes30001to40000.xml",
"lakes40001to50000.xml",
"lakes50001to60000.xml"
PropertyManager pm = new PropertyManager();
int numberOfLoadedLakes = 0;
try {
pm.initialize();
Map modelMap = (Map)pm.get(XMLConfigFile.MODEL_MAP);
LakeModel lakeModel = (LakeModel)modelMap.get(LREConcreteLakeModel.NAME);
Connection connection = ConnectionManager.getConnection();
lakeModel.setConnection(connection);
for (int i=0; i<xmlLakeFiles.length; i++) {
long then = System.currentTimeMillis();
System.out.println("Loading lake "+xmlLakeFiles[i]+"...");
numberOfLoadedLakes = lakeModel.loadModel(xmlLakeFiles);
long now = System.currentTimeMillis();
System.out.println("Loaded "+numberOfLoadedLakes+" lakes!");
System.out.println("Execution time: "+(now-then)/1000+" seconds!");
System.out.println("Loading lake "+xmlLakeFiles[i]+"...done!");
connection.close();
} catch(Exception e) {
e.printStackTrace();
My client class calls LakeLoader.loadLake() method in a loop to load a bunch of Lake objects into the DB. The first lake in the list is created without problems, but when the 2-nd lake is being inserted, I get an exception at the preparedStatement.executeUpdate() statement. This happens consistently.
I tried to find information on this on the net, but seems that this problem only happened when people dealt with LOBs?!
Thank you very much!
Georgi

Suresh -- I'd probably log a TAR with Oracle support for this question if you definitely need it resolved. Support have access to all manner of existing cases, so this may be something they have seen before.
cheers
-steve-

Similar Messages

  • Io exception: End of TNS data channel when Indexing

    I am trying to create an index on a column which contains rules to be used with CTXRULE. I would also like to improve the wildcard search, so that searching for
    "depletes" would be matched up with the rule "%deplete%". I am also using a blank stopwords list as the rules are quite precise.
    For that, I am creating the following preferences:
    -- create new pref
    exec Ctx_Ddl.Create_Preference('wildcard_pref', 'BASIC_WORDLIST');
    -- allows better %abc%
    exec ctx_ddl.set_attribute('wildcard_pref','SUBSTRING_INDEX', 'TRUE');
    or
    -- allows better abc%
    exec ctx_ddl.set_attribute('wildcard_pref','prefix_index', 'YES');
    exec ctx_ddl.set_attribute('wildcard_pref','PREFIX_MIN_LENGTH', 3);
    exec ctx_ddl.set_attribute('wildcard_pref','PREFIX_MAX_LENGTH', 10);
    -- drop existing stoplist pref
    exec ctx_ddl.drop_stoplist('stoplist_pref');
    -- create new stoplist pref
    exec ctx_ddl.create_stoplist('stoplist_pref');
    create index testrule_IDX on test_table(rules)
    indextype is ctxsys.CTXRULE
    parameters ('Wordlist wildcard_pref Stoplist stoplist_pref');
    The above script works fine until it comes to creating the index, upon which I get the following error (line numbers different):
    Error starting at line 11 in command:
    create index testrule_IDX on test_table(rules)
    indextype is ctxsys.CTXRULE
    parameters ('Wordlist wildcard_pref Stoplist stoplist_pref')
    Error at Command Line:11 Column:0
    Error report:
    SQL Error: Io exception: End of TNS data channel
    However, if I don't include the additional attributes, the index gets created without any issues.
    I am using Oracle 10.2.0.3 on UNIX, and running the code through SQL developer.
    Any help would be greatly appreciated.
    Thanks.

    According to the documentation wildcards and prefix and substring indexes are not supported with ctxrule. If you try to use these things, the index may not get created. If you are creating your index from SQL*Plus, you should get a specific error message telling you that or you might get more information from ctx_user_index_errors. If you try to use a wildcard in your rules, it seems to cause the whole query to return no rows. However, if you user a lexer with index_stems, it seems to return all words that have the same stem word as the search word in the rules. Please see the demonstration below with and without the index_stems.
    SCOTT@orcl_11g> CREATE TABLE test_table
      2  (rulesid     NUMBER PRIMARY KEY,
      3   category     VARCHAR2(30),
      4   rules     VARCHAR2(30))
      5  /
    Table created.
    SCOTT@orcl_11g> INSERT INTO test_table VALUES (1, 'cat1', 'charge')
      2  /
    1 row created.
    SCOTT@orcl_11g> INSERT INTO test_table VALUES (2, 'cat2', 'deplete')
      2  /
    1 row created.
    SCOTT@orcl_11g> create index testrule_IDX on test_table(rules)
      2  indextype is ctxsys.CTXRULE
      3  /
    Index created.
    SCOTT@orcl_11g> SELECT * FROM test_table WHERE MATCHES (rules, 'charge') > 0
      2  /
       RULESID CATEGORY                       RULES
             1 cat1                           charge
    SCOTT@orcl_11g> SELECT * FROM test_table WHERE MATCHES (rules, 'charged') > 0
      2  /
    no rows selected
    SCOTT@orcl_11g> SELECT * FROM test_table WHERE MATCHES (rules, 'charges') > 0
      2  /
    no rows selected
    SCOTT@orcl_11g> SELECT * FROM test_table WHERE MATCHES (rules, 'charging') > 0
      2  /
    no rows selected
    SCOTT@orcl_11g> SELECT * FROM test_table WHERE MATCHES (rules, 'recharge') > 0
      2  /
    no rows selected
    SCOTT@orcl_11g> SELECT * FROM test_table WHERE MATCHES (rules, 'depletes') > 0
      2  /
    no rows selected
    SCOTT@orcl_11g> SELECT * FROM test_table WHERE MATCHES (rules, 'other') > 0
      2  /
    no rows selected
    SCOTT@orcl_11g> drop index testrule_idx
      2  /
    Index dropped.
    SCOTT@orcl_11g> BEGIN
      2    ctx_ddl.create_preference('mo_lexer','BASIC_LEXER');
      3    ctx_ddl.set_attribute('mo_lexer', 'INDEX_STEMS', 'ENGLISH');
      4  END;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11g> create index testrule_IDX on test_table(rules)
      2  indextype is ctxsys.CTXRULE
      3  parameters ('lexer mo_lexer')
      4  /
    Index created.
    SCOTT@orcl_11g> SELECT * FROM test_table WHERE MATCHES (rules, 'charge') > 0
      2  /
       RULESID CATEGORY                       RULES
             1 cat1                           charge
    SCOTT@orcl_11g> SELECT * FROM test_table WHERE MATCHES (rules, 'charged') > 0
      2  /
       RULESID CATEGORY                       RULES
             1 cat1                           charge
    SCOTT@orcl_11g> SELECT * FROM test_table WHERE MATCHES (rules, 'charges') > 0
      2  /
       RULESID CATEGORY                       RULES
             1 cat1                           charge
    SCOTT@orcl_11g> SELECT * FROM test_table WHERE MATCHES (rules, 'charging') > 0
      2  /
       RULESID CATEGORY                       RULES
             1 cat1                           charge
    SCOTT@orcl_11g> SELECT * FROM test_table WHERE MATCHES (rules, 'recharge') > 0
      2  /
    no rows selected
    SCOTT@orcl_11g> SELECT * FROM test_table WHERE MATCHES (rules, 'depletes') > 0
      2  /
       RULESID CATEGORY                       RULES
             2 cat2                           deplete
    SCOTT@orcl_11g> SELECT * FROM test_table WHERE MATCHES (rules, 'other') > 0
      2  /
    no rows selected
    SCOTT@orcl_11g> spool off

  • Java servlet - Io exception: End of TNS data channel

    Okay, I'm trying to upload a picture through a servlet into a database. I've tested the my method PictureDAO.storePicture(File file) localy and it works fine. In the servlet I create the uploaded picture in a directory on the server, and this works fine too. When I call the same method as I've already tested, I get the following exception:
    Io exception: End of TNS data channel
    oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
    oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2061)
    oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
    oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
    oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
    rockIt.db.PictureDAO.storePicture(PictureDAO.java:79)
    this is line 79:      if( INSERT_PICTURE.executeUpdate() > 0 ) {
           return true;
    and this is the pstm:
    INSERT_PICTURE = connection.prepareStatement("INSERT INTO pictures " +
                                                 "(picture, fileName, approved) " +
                                                 "VALUES ( ?, ?, ? )");Since I've tested this method locally and know that it works, I just don't understand why it doesn't work on the server. We are using Oracle9i and Apache Tomcat/5.5.4 on my school. Could this be the problem? Anyone know what to do?
    thanks

    This will not compile, but I suspect if you change the way you're using SQL to look more
    like this, it will solve your problem. It's generally a bad idea to have Statements with a
    lifeline greater than a method.
    private static final String INSERT_PICTURE =
        "INSERT INTO pictures " +
        "(picture, fileName, approved) " +
        "VALUES ( ?, ?, ? )");
    public void insertPicture() {
        Connection connection = null;
        PreparedStatement statement = null;
        try {
            connection = XXXXX.getConnection();
            statement =
                connection.prepareStatement(INSERT_PICTURE);
            statement.executeUpdate();
        } finally {
            statement.close();
            connection.close();
    }

  • OLAP Io exception: End of TNS data channel

    Hello,
    I am running Oracle 9.2.0.1 on Sun 64. I applied the 9.2.0.4.0 and 9.2.0.4.1 patches and then created some relational cubes and dimensions and associated OLAP metadata. Everything validates correctly and I can see everything in OEM and AWM. When I run teh bi_checkconfig untility, I get the following:
    BI Beans Diagnostics(v1.0.2.0) 3/24/05
    ===============================================================================
    JDEV_ORACLE_HOME .......................... = C:\oracle\jdev10g
    JAVA_HOME ................................. = c:\java\j2sdk1.4.2
    JDeveloper version ........................ = 9.0.4.0.1407
    BI Beans release description .............. = BI Beans 9.0.4 Production Release
    BI Beans component number ................. = 9.0.4.22.0
    BI Beans internal version ................. = 2.7.5.31
    Connect to database ....................... = Successful
    JDBC driver version ....................... = 9.2.0.4.0
    JDBC JAR file location .................... = C:\oracle\jdev10g\jdev\lib\patches
    Database version .......................... = 9.2.0.4.0
    OLAP Catalog version ...................... = 9.2.0.4.1
    OLAP AW Engine version .................... = 9.2.0.4.1
    OLAP API Server version ................... = 9.2.0.4.1
    BI Beans Catalog version .................. = N/A; not installed in dms_dw
    OLAP API JAR file version ................. = 9.2
    OLAP API JAR file location ................ = C:\oracle\jdev10g\jdev\lib\ext
    Load OLAP API metadata .................... = Unsuccessful
    ============================================================================
    The error in the bi_error.log file is:
    1) Io exception: End of TNS data channel
    1) Io exception: End of TNS data channel
    ============================================================================
    oracle.express.idl.util.OlapiException: Io exception: End of TNS data channel
         at oracle.express.idl.ExpressConnectionModule.ConnectionInterfaceStub.getDefaultDatabase(ConnectionInterfaceStub.java:1502)
         at oracle.express.olapi.data.full.ExpressDataProvider.getMetadataProviderInterface(ExpressDataProvider.java:993)
         at oracle.olapi.metadata.MetadataFetcher.initialize(MetadataFetcher.java:73)
         at oracle.olapi.metadata.MetadataFetcher.<init>(MetadataFetcher.java:45)
         at oracle.olapi.metadata.BaseMetadataProvider.<init>(BaseMetadataProvider.java:47)
         at oracle.olapi.metadata.mdm.MdmMetadataProvider.<init>(MdmMetadataProvider.java:130)
         at oracle.express.olapi.data.full.ExpressDataProvider.getDefaultMetadataProvider(ExpressDataProvider.java:964)
         at oracle.dss.metadataManager.server.drivers.mdm._92.MDMMetadataDriverImpl_92.getMdmMetadataProvider(MDMMetadataDriverImpl_92.java:1133)
         at oracle.dss.metadataManager.server.drivers.mdm._92.MDMMetadataDriverImpl_92.attach(MDMMetadataDriverImpl_92.java:810)
         at oracle.dss.metadataManager.server.drivers.mdm.MDMMetadataDriverImpl.attach(MDMMetadataDriverImpl.java:125)
         at oracle.dss.metadataManager.server.MetadataManagerImpl.buildObjectModel(MetadataManagerImpl.java:1092)
         at oracle.dss.metadataManager.server.MetadataManagerImpl.attach(MetadataManagerImpl.java:969)
         at oracle.dss.metadataManager.client.MetadataManager.attach(MetadataManager.java:876)
         at oracle.dss.metadataManager.client.MetadataManager.attach(MetadataManager.java:799)
         at BICheckConfig.checkConnection(BICheckConfig.java:277)
         at BICheckConfig.main(BICheckConfig.java:1348)
    I am at a loss. If anyone has any ideas, I would really appreciate it.
    Thanks, Todd

    Todd,
    This might be bug 4112321, which is unpublished, but has similar symptoms. A fix was submitted into the 9.2.0.7 stream. You could open a TAR, including the trace file, so that a support analyst could compare your trace file to the one posted to this bug. If they are the same, a fix could possibly be backported to 9.2.0.6, but not likely to an earlier version.
    Upgrading to 9.2.0.6 would be a good idea, regardless.
    --Sharon

  • Lo exception: End of TNS data channel

    When connecting to EM DBControl, I receive error message: "lo exception: End of TNS data channel".
    Any idea?

    Ok seems like tnsnames.ora had wrong info. I did change it so I can login to EM Console but it takes a minute on average to load any page further on. This machine is idling, nobody is connected right now.

  • Io exception: End of TNS data channel

    i'm trying to call java function from pl*sql
    THIS IS MY CLASS WHICH CALL JEXCEL APIs jar :
    package ExcelGenPackage;
    import java.io.File;
    import java.io.IOException;
    import java.lang.Number;
    import java.util.Date;
    import jxl.*;
    import jxl.write.*;
    public class ExcelGenClass
    public ExcelGenClass()
    * @param args
    public static void main(String[] args)
    ExcelGenClass excelGenClass = new ExcelGenClass();
    Write_XLS();
    public static void Write_XLS()
    try
    WritableWorkbook workbook = Workbook.createWorkbook(new File("C:\\output.xls"));
    WritableSheet sheet = workbook.createSheet("First Sheet", 0);
    Label label = new Label(0, 2, "A label record");
    sheet.addCell(label);
    Label label1 = new Label(0, 4, "A Second label record ");
    sheet.addCell(label1);
    // All sheets and cells added. Now write out the workbook
    workbook.write();
    workbook.close();
    catch (JXLException e)
    System.out.println("d");
    catch (IOException e)
    System.out.println("dd");
    I Load the jar & the class into pl*sql
    then i add wrapped procedure
    PROCEDURE Test_Proc AS LANGUAGE JAVA
    NAME 'ExcelGenPackage.ExcelGenClass.Write_XLS()';
    when i call Test_Proc
    i got this exception
    Io exception: End of TNS data channel

    You will need to contact the source supplying this .jar file to find out if this is suitable to be run within the database (has it been tested successfully before) and if it is, what are the minimum DB requirements and the java requirements within the database for this to work correctly.

  • ERROR : End of TNS data channel

    java.sql.SQLException: Io exception: End of TNS data channel
    HI,
    We have a websphere application and the backend is oracle 8.1.7 on NT.
    We use JDBC for connectivity to Oracle.
    We are coming across the above mentioned error for some of the transactions.
    Also since no ORA- number is returned i'm unable to get to the cause of the error.
    If anyone of u has come across a similar situation then pl let me know the cause of the error and the solution to it.
    Thanks,
    Ravi

    ElectroD,
    Try using "LEFT OUTER JOIN" instead of LEFT JOIN alone. It might get through.
    Thanks,
    Ishan

  • XSQL : End of TNS data channel?

    Hi, I'm having trouble using the Oracle xsql servlet for a mission-critical application. Using a complicated query which has several cursors, I get the following error:
    oracle.xml.sql.OracleXMLSQLException: Io exception: End of TNS data channel
    I have the servlet deployed to Apache Tomcat 3.2 (I have also tried 3.1, with the same results). This error seems to only occur when the query selects from certain tables. However, the same query works fine in SQL*Plus or any similar tool.
    Any idea what might be causing this? If not, can you point me to someone who might have an idea?
    This seems to be a recent problem. Some queries that worked before don't work anymore. Changes that have been made since then are that the database's Net8 service was removed and re-setup, and also that all the tables and indexes in the schema have been re-analyzed.

    Whenever a problem appears to be in the XSQL Servlet -- specifically those that relate to translating SQL statements into XML -- here's a tip to help diagnose the problem.
    The XSQL action handler for the <xsql:query> action directly makes use of the Oracle XML SQL Utility to do the real work. The XSQL Pages system pools database connections and makes using the XSU easier because most common tasks can be done with templates, but when a problem arises in this area it is likely an issue with the underlying XML SQL Utility.
    To help see whether this is in fact the case, try the same query that is causing problems using the XML SQL Utility's command line OracleXML utility.
    $ OracleXML getXML -u username/password "SELECT ... "
    If you are getting TNS errors, likely the server is generating server-side trace files that might provide additional details on what the issue might be.

  • [End of TNS data channel] with Java SDO API (JDBC thin 9.0.1.2.1)

    Hello 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

    Hello folks,
    Here is what I've done:
    1. Created a "mini" Realtional model (modelB) which mimics exactly our existing "big" Realtional model (modelA). The tables, sequences, indices, etc. in modelB have been created in exactly the same fashion we'd created the corresponding entities in modelA. The only difference is that I preceeded the entities in our test modelB with "TEST_".
    2. Populated the modelB with 1298 Lakes (3993 edges in total) in exatly the same fashion we use to populate our modelA - using a Data Loader based on Java SDO API.
    3. Indexed the test modelB in exactly the same fashion as modelA.
    4. Ran the query:
    SELECT e.shape FROM test_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(
    -123.80833332065798,48.58352678668598,
    -123.80833332065798,48.675352618459506,
    -123.65050767229724,48.675352618459506,
    -123.65050767229724,48.58352678668598,
    -123.80833332065798,48.58352678668598
    ), 'mask=ANYINTERACT querytype=WINDOW'
    ) = 'TRUE'
    in SQL*PLUS and it worked fine (retrieved a bunch of geometries)!
    Ran the same query in the Daniel Geringer's OraTest utility and it worked this time and returned:
    TIME : 1.222 seconds, TOTAL FETCH TIME 267 ROWS
    Ran the query with our JCS Query Plug-In and it worked fine!
    ANALYSIS
    ========
    ModelA
    ======
    - 59652 Lakes and 178764 edges
    - it's properly indexed
    - its SDO layers and geometries are valid
    - when we count the number of related SDO geometries for this query we get:
    SQL> SELECT count(e.shape) FROM edge e WHERE SDO_RELATE(e.shape,
    2 mdsys.sdo_geometry(
    3 2003,
    4 8307,
    5 NULL,
    6 mdsys.sdo_elem_info_array(1,1003,1),
    7 mdsys.sdo_ordinate_array(
    8 -123.80833332065798,48.58352678668598,
    9 -123.80833332065798,48.675352618459506,
    10 -123.65050767229724,48.675352618459506,
    11 -123.65050767229724,48.58352678668598,
    12 -123.80833332065798,48.58352678668598
    13 )
    14 ), 'mask=ANYINTERACT querytype=WINDOW'
    15 ) = 'TRUE';
    COUNT(E.SHAPE)
    267
    - when we run the following query via the Java SDO API:
    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(
    -123.80833332065798,48.58352678668598,
    -123.80833332065798,48.675352618459506,
    -123.65050767229724,48.675352618459506,
    -123.65050767229724,48.58352678668598,
    -123.80833332065798,48.58352678668598
    ), 'mask=ANYINTERACT querytype=WINDOW'
    ) = 'TRUE'
    it FAILS with: "TNS end of communaction channel"!
    ModelB
    ======
    - 1298 Lakes and 3993 edges
    - it's properly indexed
    - its SDO layers and geometries are valid
    - when we count the number of related SDO geometries for this query we get:
    SQL> SELECT count(e.shape) FROM test_edge e WHERE SDO_RELATE(e.shape,
    2 mdsys.sdo_geometry(
    3 2003,
    4 8307,
    5 NULL,
    6 mdsys.sdo_elem_info_array(1,1003,1),
    7 mdsys.sdo_ordinate_array(
    8 -123.80833332065798,48.58352678668598,
    9 -123.80833332065798,48.675352618459506,
    10 -123.65050767229724,48.675352618459506,
    11 -123.65050767229724,48.58352678668598,
    12 -123.80833332065798,48.58352678668598
    13 )
    14 ), 'mask=ANYINTERACT querytype=WINDOW'
    15 ) = 'TRUE';
    COUNT(E.SHAPE)
    267
    - when we run the following query via the Java SDO API:
    SELECT e.shape FROM test_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(
    -123.80833332065798,48.58352678668598,
    -123.80833332065798,48.675352618459506,
    -123.65050767229724,48.675352618459506,
    -123.65050767229724,48.58352678668598,
    -123.80833332065798,48.58352678668598
    ), 'mask=ANYINTERACT querytype=WINDOW'
    ) = 'TRUE'
    it SUCCESSFULLY returns the related geometries!
    So, what can we make of all this? We know that there exists a model for which the SDO_RELATE works via the Java SDO API. This model is a subset (w.r.t. the data set) of our original model in which we detected the "TNS end of communication channel problem". The environment we used for these tests is exactly the same: JDBC Thin driver (version 9.0.1.0.0), Oracle9i Enterprise Edition (Release 9.0.1.2.1 - Production).
    One can think that the problem lies in the Oracle Object-Realational or Oracle Spatial but the fact that we can successfully execute the same SDO_RELATE queries in SQL*PLUS rejects this possibility. Perhaps it depends on the amount of data passed to the JDBC driver and the fashion in which it handles it! In our test above we had RELATED 267 geometries. We know that there exist SDO_RELATE queries that run successfully with modelA, but those are queries which ONLY retrieve an EMPTY set of RELATED geometries. In other words we don't get the "TNS end of communication channel" because NO data gets fetched from the server to the client! As soon as we find a SDO_RELATE query which retrieves (RELATES) at least 1 geometry that runs successfully in SQL*PLUS and run it via the Java SDO API - it FAILS! This means that no matter what volume of data is fetched from the server-JDBCThin-SDOAPI-client as long as there is ANY data, the query FAILS in modelA.
    Perhaps something internally in the Oracle 9i Server happens that prevent the data being fetch to the JDBCThin for that particular modelA. But what that might be?
    Very peculiar problem!
    Regards,
    Georgi

  • OC4J problem and End of TNS data channel

    We are using Oralce 9iAS with OC4J to host our java application. Recently, we kept having problem with the application. The problem is when user enters username and password to login, the application doesn't do anything until we restart OC4J instance. After tracking down all the error log files, it looks like problem happened whenever the application get "SQL Exception: End of TNS data channel" error. I don't know why are we getting this "End of TNS data channel" error. I don't think it is the application's problem.
    1)Does anybody have any idea why?
    2)Does OC4J server need to be restarted every once a while.
    Thanks in advance.

    Hi Liya -
    "End of TNS data channel" is usually a message sent by the database when something erroneous is occuring.
    What version of the database, JDBC, and JDK are you using?
    Are you getting any dump files from the database?
    Can you describe a little more about what the application code is doing?
    There is some good information on this error message at the following URL
    http://forum.java.sun.com/thread.jsp?thread=280338&forum=48&message=1090056
    -steve-

  • Java.sql.SQLException: Io exception: The Network Adapter could not establish the co

    I am using Oracle 9i Server just the
    Weblogic 5.1 and also using Oracle 8.1.6 client for weblogic. When I start the weblogic application I am getting the following error message
    "java.sql.SQLException: Io exception: The Network Adapter could not establish the co
    nnection

    On 10 Feb 2003 09:51:52 -0800, Shankar Viswanathan
    <[email protected]> wrote:
    I am using Oracle 9i Server just the
    Weblogic 5.1 and also using Oracle 8.1.6 client for weblogic. When I start the weblogic application I am getting the following error message
    "java.sql.SQLException: Io exception: The Network Adapter could not establish the co
    nnection
    "You're not providing a lot of information here, but I'll assume a few
    things and say...
    Ensure the URL param is set properly in the pool def. Check hostname,
    port and database/TNS entry. Also, try dbpinging the database with the
    following:
    java utils.dbping ORACLE <user> <password> <dbname>
    substitute the appropriate values where necessary. For example, I have
    a TNS def called 'jforum.world' for a particular oracle instance. User
    is 'auser' and the password is 'apass'. The following command will
    test the connection:
    java utils.dbping ORACLE auser apass jforum.world
    Alternatively, you can try tnsping, an oracle util, to test the
    connectability.
    If either of these utils work, then it's probably a typo somewhere in
    the pool properties.
    Bon

  • Error connecting to database - java.sql.SQLException: Io exception: The Net

    Hello friends,
    I know this question has been asked in a lot of other threads; but my problem is quite unique and that's why I'm starting a new thread...
    When I try to access an Oracle 10g database through a Servlet code using a JDBC thin driver (both Tomcat and the database are running on Solaris 9), I get the following error:
    "Error connecting to database - java.sql.SQLException: Io exception: The Network Adapter could not establish the connection"
    However, there is another application running on the same server using the same database server (only the actual databases being used differ) and it is able to access the database without any issues. Both of these are absolutely similar applications and I couldn't think of any reasons why one would work and the other wouldn't. I thought they might be conflicting each other and tried running only the problematic application. But even then, I get the same error.
    I know this might not be too relevant but to provide you some more information on the environment, the applications are running on separate Tomcat instances on the same server and they are connected to an Apache web server through Mod jk.
    Any help in solving this problem is greatly appreciated!
    Thanks!
    Regards,
    Yogaesh

    Yogaesh wrote:
    The 'application' that works is also a Tomcat application... It's exactly same as the problematic application in terms of the configuration and stuff... As for the typo errors, I copied the config info and pasted it... So pretty much it should be the same. And to add an additional note, I'm able to connect to the database from my localhost... I mean if I run the problematic application from localhost (without Apache and directly hitting Tomcat) I'm able to access the screens...
    The second part of that (localhost) usually isn't all that useful. You know it is a connection failure so that means the code is running and technically successfully (since connection failure is a legitimate runtime error.)
    You know it isn't a firewall issue because it connects from another app in tomcat. So it must be a configuration issue.
    So something like one of the following.
    1. It isn't the same (we already know this but this particular item means that it is not in fact exactly the same because you deliberately or accidently modified it.)
    2. It isn't pulling the right config. Maybe you aren't packaging it, maybe it is buffered on the server and it is using that rather than what you think it is.
    3. Java code is referring to the wrong name.
    Do this, change the configuration so it points to a server that does not exist. Repack, redeploy. If the error is the same (no diff) then you know that it is not running the code that you think it is. If it does change then you know that it can only be 1.

  • Exception in thread "main" java.sql.SQLException: Io exception: Connection

    Hello
    I created a java program to connect to a oracle database 10g
    I got the following error:
    Exception in thread "main" java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=153093632)(ERR=12514)(ERROR_STACK=(ERROR=(CODE=12514)(EMFI=4))))
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:334)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:418)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:521)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:325)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at dbAccess.main(dbAccess.java:10)
    here the code
    import java.sql.*;
    class dbAccess {
    public static void main (String args []) throws SQLException
         if (args.length<=0) {System.out.println("You need to provide the user and password");System.exit(0);}
    DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@dathvader2003:1521:orcl", args[0], args[1]);
    // @machineName:port:SID, userid, password
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery("select BANNER from SYS.V_$VERSION");
    while (rset.next())
    System.out.println (rset.getString(1)); // Print col 1
    stmt.close();
    Any helps?
    Many thanks

    This is the exactly code
    import java.io.PrintStream;
    import java.sql.*;
    import oracle.jdbc.driver.OracleDriver;
    class dbAccess
    dbAccess()
    public static void main(String args[])
    throws SQLException
    if(args.length <= 0)
    System.out.println("You need to provide the user and password");
    System.exit(0);
    DriverManager.registerDriver(new OracleDriver());
    Connection connection = DriverManager.getConnection("jdbc:oracle:thin:@dathvader2003:1521:orcl", args[0], args[1]);
    Statement statement = connection.createStatement();
    for(ResultSet resultset = statement.executeQuery("select BANNER from SYS.V_$VERSION"); resultset.next(); System.out.println(resultset.getString(1)));
    statement.close();
    }

  • Web Service Error: java.sql.SQLException: Io exception: Broken pipe

    Hi,
    I am using JDeveloper PL/SQL web service generator. After some time we start receiving the "java.sql.SQLException: Io exception: Broken pipe" exception when we invoke the web service. I've noticed that the error starts occuring once all the connections in the database have been closed.
    Here are the Data Source configurations I tried using:
    <data-source name="jdev-connection-SACS" class="com.evermind.sql.DriverManagerDataSource" location="jdbc/SACSCoreDS" xa-location="jdbc/xa/SACSXADS" ejb-location="jdbc/SACSDS" pooled-location="jdbc/MACSPooledDS" connection-driver="oracle.jdbc.driver.OracleDriver" username="xxx" password="xxxx" url="jdbc:oracle:thin:@test:1521:SACS" inactivity-timeout="30" connection-retry-interval="3" max-connections="5" min-connections="0" wait-timeout="20"/>
    AND I also tried:
    <data-source name="jdev-connection-SACS" class="com.evermind.sql.DriverManagerDataSource" location="jdbc/SACSCoreDS" xa-location="jdbc/xa/SACSXADS" ejb-location="jdbc/SACSDS" pooled-location="jdbc/SACSPooledDS" connection-driver="oracle.jdbc.driver.OracleDriver" username="xxxx" password="xxxx" url="jdbc:oracle:thin:@xxxx:1521:SACS" inactivity-timeout="30"/>
    That did not make any changes.
    I then changed ConnectionContext.KEEP_CONNECTION to ConnectionContext.CLOSE_CONNECTION in the <name>Base.sqlj:
    public void release() throws SQLException
    { if (__tx!=null && __onn!=null) __tx.close(ConnectionContext.CLOSE_CONNECTION);
    __onn = null; __tx = null;
    That did not help either. We are running these web services on the standalone OC4J and Oracle 8.1.7.2 database with the MTS installed on it.

    Hi,
    I don't use JDeveloper to develop stored procedure web services. However, I do use WebServicesAssembler.jar to generate stored procedure web services.
    I had the same problem as you did. After some research in this forum, I was informed that it's a bug in the web services generator itself. I was also informed that the newest version of WebServicesAssembler.jar is supposed to fix the problem.
    If you want, you can always write a batch job to restart the OC4J periodically. The command is
    dcmctl -ct oc4j -co home
    If I come across the posting containing the answer to your solution, I will forward it to you.
    Good luck
    Jack

  • Java.sql.SQLException: setNString, Exception = 3

    Hello,
    We have a situation where during a multi user testing, we are getting the following exception while excecuting a query. We are using the datasource mechanism provided by web logic.
    When we tries to set a param value using the setNString, we get the following. The exception does not give you more information.
    java.sql.SQLException: setNString, Exception = 3
    The logic flow looks like this:
    Connection = datasource.getConnection();
    try {
    PrepareStatement = connection.preparestatement();
    statement.setNString(param index, string value);
    finally {
    connection.close();
    Any ideas?
    Thanks,
    Sree Menon ([email protected])

    I left out some other details:
    The insert statement is:
    insert into CALCMGRSEQUENCES (ID, NAME, UPPERNAME, DESCRIPTION, OWNER, CREATED, MODIFIEDBY, L
    ASTMODIFIED, LOCKEDBY, OPENFOREDITINGBY, ISOPENFOREDITING, OBJECTTYPEID, PRODUCT
    TYPE, PROPERTY, BODY, LOCATION, LOCATIONSUBTYPE, VALIDATESTATUS, DEPLOYSTATUS) v
    alues(SEQ_CALCMGRSEQUENCES.NEXTVAL, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
    The exception stack also says:
    Caused By: java.lang.ArrayIndexOutOfBoundsException: 3
    at oracle.jdbc.driver.OraclePreparedStatement.setFormOfUse(OraclePreparedStatement.java:12563)
    at oracle.jdbc.driver.OraclePreparedStatement.setNStringInternal(OraclePreparedStatement.java:13873)
    at oracle.jdbc.driver.OraclePreparedStatement.setNString(OraclePreparedStatement.java:13681)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.setNString(OraclePreparedStatementWrapper.java:240)
    at weblogic.jdbc.wrapper.PreparedStatement.setNString(PreparedStatement.java:1553)
    Clearly, there are more than 3 parameters.
    Thanks,
    Sree

Maybe you are looking for

  • OSS Note #838429

    Hi all, Is there anybody who have already read OSS #838429 ? in the solution, they mentioned about do not load infosource 2LIS_02_ITM and 2LIS_02_HDR. But I use them for my cube 0PUR_C01. Maybe there is anybody know whether there is any problem on th

  • DTR Permission problem

    Hi, I cannot set DTR permissions using the Eclipse plugin. I´m Administrator and JDI Administrator (CBS.Administrator, CMS.Administrate). In Visual Admin, Security Provider Service for the application sap.com/tcdtrenterpriseapp*dtr the following secu

  • Don't buy Vodafone contracts with if you require T...

    I like many other Nokia users have been blocked from normal TV streaming including BBC, ITV...as they are termed as ADULT content by VF. Only Apple iPhone is not blocked, therefore you're better off with other networks if you would like to have a Nok

  • Trouble Downloading Adobe Flash

    I've attempted downloading Adobe Flash Player a few times, at first I had it downloaded onto my computer but for some reason videos still weren't working so I uninstalled it and tried reinstalling it but it wouldn't work so I've messed with the Inter

  • Aperture imports the raw images from my new Olmpus e-p5 as .orf files and does not recognize them. What can I do?

    Is there another way to convert the .orf files that are not being recognized ? I used a card reader. The Olympus Viewer software reads the raw images just fine. Thanks