0 Replies Latest reply on Dec 26, 2014 7:11 PM by 644964

    Error code: 17410: No more data to read from socket

    644964

      We have a strange issue.

      We have a stored procedure which we invoke using JDBC code. Calls to this stored procedure runs fine on 2 databases but fails on the 3rd one. If we run the stored procedure using SQL Plus, it works fine.

      SQLException being thrown is:
      java.sql.SQLException: No more data to read from socket

      Oracle database version is Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production in all three environments

      While debugging the issue we figure the order of Java code made a difference while invoking the stored procedure that did not initially work.

      Original Code:
      ----------------------------------------------------------------------------------------------
      ArrayDescriptor desc = ArrayDescriptor.createDescriptor( "SCHOOLLISTTYPE", conn );

      StructDescriptor structdesc = StructDescriptor.createDescriptor( "SCHOOLCODEOBJ", conn );

      Object[] attributes1 = { new String( "00131700" ), new String( "00" ) };
      STRUCT empType1 = new STRUCT( structdesc, conn, attributes1 );
      Object[] attributes2 = { new String( "00115900" ), new String( "01" ) };
      STRUCT empType2 = new STRUCT( structdesc, conn, attributes2 );
      Object[] attributes3 = { new String( "03078200" ), new String( "00" ) };
      STRUCT empType3 = new STRUCT( structdesc, conn, attributes3 );

      Object[] arrayElements = { empType1, empType2, empType3 };

      ARRAY newArray = new ARRAY( desc, conn, arrayElements );

      CallableStatement ps = conn.prepareCall( "{call AWSchools.Names (?, ?, ?)}" );
      ----------------------------------------------------------------------------------------------------------------

      Throws the SQLException mentioned above.

      But if I change the code to:

      ----------------------------------------------------------------------------------------------
      StructDescriptor structdesc = StructDescriptor.createDescriptor( "SCHOOLCODEOBJ", conn );

      Object[] attributes1 = { new String( "00131700" ), new String( "00" ) };
      STRUCT empType1 = new STRUCT( structdesc, conn, attributes1 );
      Object[] attributes2 = { new String( "00115900" ), new String( "01" ) };
      STRUCT empType2 = new STRUCT( structdesc, conn, attributes2 );
      Object[] attributes3 = { new String( "03078200" ), new String( "00" ) };
      STRUCT empType3 = new STRUCT( structdesc, conn, attributes3 );

      Object[] arrayElements = { empType1, empType2, empType3 };

      ArrayDescriptor desc = ArrayDescriptor.createDescriptor( "SCHOOLLISTTYPE", conn );

      ARRAY newArray = new ARRAY( desc, conn, arrayElements );

      CallableStatement ps = conn.prepareCall( "{call AWSchools.Names (?, ?, ?)}" );


      ----------------------------------------------------------------------------------------------------------------

      code works fine.

      This is strange as the ArrayDescriptor and StructDescriptor and independent objects till we invoke ARRAY newArray = new ARRAY( desc, conn, arrayElements );

      Why would creating the ArrayDescriptor after we have done with arrayElements and desc make a difference?

      And this happens only with one database server. The original code works fine in other 2 oracle database.

      We did search in many forums about the error "No more data to read from socket". Seems this is a dark error which does not have any convincing answers.

      Any help will be greatly appreciated.

      Thanks.