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

 

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

2 comments

  1. This may be A reason you can get this error but it is not THE reason you get the error. Most posts I have come across say this is a bug in Oracle itself. And you should NOT have to turn auto commit off. I do and I still get this error but I shouldn’t have to in order to interact with the DB.

Leave a Reply

Your email address will not be published. Required fields are marked *