Site icon IT Tutorial

No more data to read from socket | java.sql.sqlexception and java.sql.sqlrecoverableexception

Hi,

I got ” No more data to read from socket | java.sql.sqlexception and java.sql.sqlrecoverableexception ” error in Oracle.

 

 

No more data to read from socket

 

Details of error are as follows.

SQLException: No more data to read from socket
SQLRecoverableException: No more data to read from socket
java.sql.SQLRecoverableException: No more data to read from socket


 

 

No more data to read from socket error is related with the generic communications error. This is usually seen as TNS connectivity issue.

When you see this error on your Application errorlog, then check your connection with the Oracle server. Probably Application server is disconnected from Oracle Server.

You can increase initialSize and maxActive size of connection pool on your Application.

Eventhough No more data to read from socket error is related with communication and network error, This error is reported as Oracle Bug in 11g. If you see this error in the 11g, then you may think upgrade database to 12c or 19c.

 

java.sql.sqlexception no more data to read from socket

The issue is caused by not setting autocommit=FALSE within the beginRequest and endRequest block for Application Continuity.

Forgetting to disable autocommit, which defaults to true, causes the first (implicit) commit to turn off replay if SESSION_STATE_CONSISTENCY is set to DYNAMIC.

In this case, oconn.setAutoCommit(false) is set outside the the beginRequest and endRequest block.

 

To solve this error, Set autocommit to false as below:

((oracle.jdbc.replay.ReplayableConnection)oconn).beginRequest();

  oconn.setAutoCommit(false);
  // Get the current value of the sequence number.
  s=oconn.createStatement();
  rs=s.executeQuery("SELECT SEQ_VALUE FROM RAC_TEST");
  if (rs.next()) {
  sequence=rs.getInt(1);

 

 

 

Do you want to learn Oracle SQL, then read the following articles.

Oracle SQL Tutorials For Beginners – Learn Oracle SQL from scratch with Oracle SQL Online Course

 

Exit mobile version