1 Reply Latest reply: Jul 23, 2012 2:33 PM by rp0428 RSS

    "No more data to read from socket" random SQLException on JDBC

    937847

      Hi to all,
      I'm having this SQLException "No more data to read from socket", when I try to execute the same sentence two times over my Oracle connection. The connection, which instance I mantain on a Singleton class, suddenly closes... I just can't find a pattern on this behaviour, and I've spent 3 weeks on figuring it out. :s

      The strange thing is that my code works right when using the OJDBC Statement class, but when I use the CallableStatement class it's doing this. It seems to happen when I try to execute the same query two times... but I can't figure out why this is, or if the connection can suddenly broke down if an error occurs or something...

      The driver version I'm using is 10.2.0.1.0 and the environment a Jetty server over windows, connecting with Oracle 11g XE.
      Here is the code I'm trying to run.

      Code without problems:

       Statement stmt = conn.createStatement(); ResultSet rset = stmt.executeQuery(columnsSQL);

      Code WITH problems:

       String plsqlBlock = (String) blocks.next(); //get the plsql code from a file - this is working just fine CallableStatement cs = (CallableStatement) conn.prepareCall("begin execute immediate ?; end;"); cs.setString(1, plsqlBlock); int res = cs.executeUpdate();

      Could anyone, please, give me a clue on what might be happening? Let me know if I can submit further details of the issue.
      Many thanks in advance!
      Regards,
      Carolina.-