No more data to read from socket error

We use Oracle as a database for our web application. The application works most of the time, but we get this error "No longer read socket data."

Caused by: java.sql.SQLRecoverableException: No more data to read from socket at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1142) at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1099) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:288) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:191) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:523) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:207) at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:863) at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1153) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1275) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3576) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3620) at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93) at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208) at org.hibernate.loader.Loader.getResultSet(Loader.java:1869) at org.hibernate.loader.Loader.doQuery(Loader.java:718) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:270) at org.hibernate.loader.Loader.doList(Loader.java:2449) ... 63 more 

We use spring, hibernate, and I have the following for the data source in my application context file.

 <bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSource"> <property name="driverClassName" value="${database.driverClassName}" /> <property name="url" value="${database.url}" /> <property name="username" value="${database.username}" /> <property name="password" value="${database.password}" /> <property name="defaultAutoCommit" value="false" /> <property name="initialSize" value="10" /> <property name="maxActive" value="30" /> <property name="validationQuery" value="select 1 from dual" /> <property name="testOnBorrow" value="true" /> <property name="testOnReturn" value="true" /> <property name="poolPreparedStatements" value="true" /> <property name="removeAbandoned" value="true" /> <property name="logAbandoned" value="true" /> </bean> 

I am not sure if this is due to application errors, database errors or network errors.

We see the following in oracle logs

 Thu Oct 20 10:29:44 2011 Errors in file d:\oracle\diag\rdbms\ads\ads\trace\ads_ora_3836.trc (incident=31653): ORA-03137: TTC protocol internal error : [12333] [4] [195] [3] [] [] [] [] Incident details in: d:\oracle\diag\rdbms\ads\ads\incident\incdir_31653\ads_ora_3836_i31653.trc Thu Oct 20 10:29:45 2011 Trace dumping is performing id=[cdmp_20111020102945] Thu Oct 20 10:29:49 2011 Sweep [inc][31653]: completed Sweep [inc2][31653]: completed Thu Oct 20 10:34:20 2011 Errors in file d:\oracle\diag\rdbms\ads\ads\trace\ads_ora_860.trc (incident=31645): ORA-03137: TTC protocol internal error : [12333] [4] [195] [3] [] [] [] [] Incident details in: d:\oracle\diag\rdbms\ads\ads\incident\incdir_31645\ads_ora_860_i31645.trc Thu Oct 20 10:34:21 2011 

Oracle Version: 11.2.0.1.0

+55
spring oracle jdbc hibernate
Oct 20 '11 at 17:38
source share
11 answers

For such errors, you need to enable oracle support. Unfortunately, you do not mention which release of the oracle you are using. The error may be related to the search for links to the optimizer. Different workarounds apply depending on the version of the oracle.

You have two ways to solve this problem:

  • go to 11.2
  • set oracle parameter _optim_peek_user_binds = false

Of course, underscore options should only be set if oracle support is supported.

+28
Oct 21 '11 at 4:28
source share

We faced the same problem, we solved it by increasing the size of the connection pool initialSize and maxActive .

You can check this link.

Maybe this helps someone.

+8
Mar 19 '14 at 9:20
source share

Another case. If you are sending date parameters to parameterized sql, be sure to send java.sql.Timestamp and not java.util.Date . Otherwise you will receive

java.sql.SQLRecoverableException : no more data to read from socket

Example: In our java code, we use org.apache.commons.dbutils , and we have the following:

 final String sqlStatement = "select x from person where date_of_birth between ? and ?"; java.util.Date dtFrom = new Date(); //<-- this will fail java.util.Date dtTo = new Date(); //<-- this will fail Object[] params = new Object[]{ dtFrom , dtTo }; final List mapList = (List) query.query(conn, sqlStatement, new MapListHandler(),params); 

The above was unsuccessful until we changed the java.sql.Timestamp date options

 java.sql.Timestamp tFrom = new java.sql.Timestamp (dtFrom.getTime()); //<-- this is OK java.sql.Timestamp tTo = new java.sql.Timestamp(dtTo.getTime()); //<-- this is OK Object[] params = new Object[]{ tFrom , tTo }; final List mapList = (List) query.query(conn, sqlStatement, new MapListHandler(),params); 
+6
Jul 14 '17 at 5:36 on
source share

Try two things:

  • Set in $ ORACLE_HOME / network / admin / tnsnames.ora on the server server oracle = allocated to server = shared to connect multiple connections at the same time. Restart the oracle.
  • If you use Java, this can help you: In java/jdk1.6.0_31/jre/lib/security/Java.security change securerandom.source=file:/dev/urandom to securerandom.source=file:///dev/urandom
+5
Nov 23 '12 at 23:27
source share

I had the same problem. I was able to solve the problem on the application side in the following scenario:

JDK8, spring framework 4.2.4.RELEASE, apache tomcat 7.0.63, Oracle Database 11g Enterprise Edition 11.2.0.4.0

I used the apache tomcat-jdbc database connection pool:

As a reference, you can use the following configuration parameters:

 <Resource name="jdbc/exampleDB" auth="Container" type="javax.sql.DataSource" factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" testWhileIdle="true" testOnBorrow="true" testOnReturn="false" validationQuery="SELECT 1 FROM DUAL" validationInterval="30000" timeBetweenEvictionRunsMillis="30000" maxActive="100" minIdle="10" maxWait="10000" initialSize="10" removeAbandonedTimeout="60" removeAbandoned="true" logAbandoned="true" minEvictableIdleTimeMillis="30000" jmxEnabled="true" jdbcInterceptors="org.apache.tomcat.jdbc.pool.interceptor.ConnectionState; org.apache.tomcat.jdbc.pool.interceptor.StatementFinalizer" username="your-username" password="your-password" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@localhost:1521:xe"/> 

This configuration was sufficient to correct the error. This works fine for me in the above scenario.

Learn more about configuring apache tomcat-jdbc: https://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html

+4
Jun 07 '16 at 1:16
source share

Lowering the JRE from 7 to 6 fixed this problem for me.

+3
Jul 02 '14 at 16:21
source share

This is a very low level exception - ORA-17410.

This can happen for several reasons:

  1. Temporary network problem.

  2. Incorrect JDBC driver version.

  3. Some problems with the special data structure (on the database side).

  4. Database Error.

In my case, it was a mistake that we ended up in a database that needs to be fixed.

+3
Apr 03 '18 at 13:45
source share

Yes, as @ggkmath said, sometimes a good old restart is exactly what you need. For example, when โ€œcontact the author and ask him to rewrite the application, but wait for now,โ€ this is not an option.

This happens when the application is not written (yet) in such a way that it can handle reloads of the base database.

0
Sep 20 '17 at 12:01
source share

In our case, we had a request that loads several elements using select * from x, where something in (...) the Part has been taking so long for a performance test (17 MB as a text request). The request is valid, but the text takes so long. Reducing the request solved the problem.

0
Oct 19 '18 at 2:18
source share

It seems I fixed my instance by removing the parameter placeholder for the parameterized query.

For some reason, using these placeholders worked fine and then they stopped working and I got an error / error.

As a workaround, I replaced the literals for my placeholders, and it started working.

Delete it

 where SOME_VAR = :1 

Use this

 where SOME_VAR = 'Value' 
0
Jul 20 '19 at 0:35
source share

I got this error and then restarted my GlassFish server, which had connection pools between my client application and the database, and the error went away. So, try restarting the application server, if applicable.

-one
Oct 18 '13 at 21:30
source share



All Articles