No more data to read from socket error
For errors like this you should involve oracle support. Unfortunately you do not mention what oracle release you are using. The error can be related to optimizer bind peeking. Depending on the oracle version different workarounds apply.
You have two ways to address this:
- upgrade to 11.2
- set oracle parameter
_optim_peek_user_binds = false
Of course underscore parameters should only be set if advised by oracle support
Another case: If you are sending date parameters to a parameterized sql, make sure you sent java.sql.Timestamp
and not java.util.Date
. Otherwise you get
java.sql.SQLRecoverableException
: No more data to read from socket
Example statement: In our java code, we are using 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 failjava.util.Date dtTo = new Date(); //<-- this will failObject[] params = new Object[]{ dtFrom , dtTo };final List mapList = (List) query.query(conn, sqlStatement, new MapListHandler(),params);
The above was failing until we changed the date parameters to be java.sql.Timestamp
java.sql.Timestamp tFrom = new java.sql.Timestamp (dtFrom.getTime()); //<-- this is OKjava.sql.Timestamp tTo = new java.sql.Timestamp(dtTo.getTime()); //<-- this is OKObject[] params = new Object[]{ tFrom , tTo };final List mapList = (List) query.query(conn, sqlStatement, new MapListHandler(),params);