JDBC Thin Intermittenty Aborts Connection with Error "java.net.SocketException: Software caused connection abort: recv failed" using Shared Server on Vista or Higher (Doc ID 1168363.1)

Last updated on JULY 26, 2017

Applies to:

JDBC - Version 10.2.0.5 to 11.2.0.2.0 [Release 10.2 to 11.2]
z*OBSOLETE: Microsoft Windows Vista x64 (64-bit)
z*OBSOLETE: Microsoft Windows Server 2008 x64 (AMD64/EM64T)
z*OBSOLETE: Microsoft Windows Vista (32-bit)
z*OBSOLETE: Microsoft Windows Server 2008 (32-bit)
Microsoft Windows x64 (64-bit) - OS Version: 7
Microsoft Windows (32-bit) - OS Version: 7
Microsoft Windows x64 (64-bit) - Version: 2008 R2

Symptoms

JDBC thin driver (11.1.0.7 or higher) is being used on Windows computers after Windows Vista.  The thin connection is being established using Shared Server. 

Intermittently the connection aborts.  Below are exception stack traces that have been identified to be related to this issue:

java.sql.SQLRecoverableException: Closed Connection
at oracle.jdbc.driver.PhysicalConnection.needLine(PhysicalConnection.java:5139)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1245)
at oracle.jdbc.driver.OracleStatement.doScrollExecuteCommon(OracleStatement.java:4735)
at oracle.jdbc.driver.OraclePreparedStatement.doScrollPstmtExecuteUpdate(OraclePreparedStatement.java:10184)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3447)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3493)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491)

or

IO Exception: Software caused connection abort: recv failed
java.sql.SQLRecoverableException: IO Exception: Software caused connection abort: recv failed
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:101)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:521)
at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:791)
at oracle.jdbc.driver.T4CStatement.executeMaybeDescribe(T4CStatement.java:855)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1377)
at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:387)
at sample.JdbcCheck.main(JdbcCheck.java:27)
Caused by: java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at oracle.net.ns.Packet.receive(Packet.java:240)
at oracle.net.ns.DataPacket.receive(DataPacket.java:92)
at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:172)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:117)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:92)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:77)
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1034)
at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1010)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:588)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:183)
at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:780)

The key is that the connection is aborted with:
java.net.SocketException: Software caused connection abort: recv failed

This was not seen in the first stack trace, so it was unclear if the same issue was hit.  In that case JDBC logging with level on SEVERE helped further with the following entry displayed just before java.sql.SQLRecoverableException: Closed Connection:

2010-08-05 13:33:51,917 SEVERE [oracle.jdbc.driver] (WorkerThread#12[X.X.X.X:50311]) Throwing SQLException: java.net.SocketException: Software caused connection abort: recv failed
2010-08-05 13:33:51,924 SEVERE [oracle.jdbc.driver] (WorkerThread#12[X.X.X.X:50311]) Throwing SQLException: 8

Changes

Upgrade of JDBC driver to 11.1.0.7 or higher
or
upgrade of client Operating System
or
Shared Server has been configured and is being used.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms