Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

ORA-17002 IO exception: Software caused connection abort

sperkmandlNov 24 2010 — edited Oct 15 2014
Hi all, I use JDBC with java 6. Environment is:

OracleOracle Database 11g Release 11.1.0.6.0 - 64bit Production
Oracle JDBC driver 11.1.0.7.0-Production

I created a simple table with a constraint, then I inserted one row:

CREATE TABLE Test (
name VARCHAR2(40 char),
UNIQUE (name)
);
INSERT into Test VALUES ('any');

Fine so far. Then - after connecting through JDBC - I repeated the above insert 16 times using conn.createStatement().execute().
I got all the times an expected error (ORA-00001) because of uniqueness violation,
but after inserting one more row I got:

ORA-17002 IO exception: Software caused connection abort: recv failed

At this point connection was closed. Similar effects can be achieved though other constraint violations.
Stack trace is:

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.executeForRows(T4CStatement.java:958)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222)
at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1770)
at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1739)
at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:299)

I couldn't find any solution after googling around.
Thanks for any suggestion.

Comments

Joe Weinstein-Oracle
That looks like a failure in the DBMS that required it to close the session
out from under the JDBC driver. Have your DBA watch the DBMS while
you do this and/or check the error log of the DBMS.
sperkmandl
Indeed. As a further hint, I can't reproduce this error using SQL Developer against the same server. However it uses ojdb5.jar, while I'm using ojdb6.jar (replacing it in SQL developer installlation prevents this tool to run properly).
Since I manage that db myself (it's in a VM), where should I look for proper tracing ?
In /opt/oracle/ora/diag/rdbms/ora11gr1/ora11gr1/incident there is no subdir having recent dates (ora11gr1 is the instance name).
Thanks.
sperkmandl
I also set ALTER SYSTEM SET trace_enabled = TRUE, then made the mentioned error to happen again. No significant trace info was written.
I feel that on jdbc side there is a receiving error (such as a protocol mismatch) which forces the client to shutdown the connection. The server then doesn't detect any error.
Indeed the stack trace suggests that:

Caused by: java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
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.executeForRows(T4CStatement.java:942)
EJP
This is not a DBMS error. It indicates prior severe network problems such that the TCP stack has decided the connection is unusable.
sperkmandl
Agree, nevertheless it is fully reproduceable using ojdbc6.jar - I mean it is not a random connectivity problem.
Unfortunately the only tool I know of using jdbc is SQL dev., which uses odbc5.jar.
In that case this problem does not appear.
EJP
Nobody said anything about connectivity problems. I said something about network problems. Not the same thing. There's a Microsoft article about that error message. Read it. It has nothing specifically to do with SQL.
sperkmandl wrote:
Indeed. As a further hint, I can't reproduce this error using SQL Developer against the same server.
You run the client on the same box (virtual space) as you run the 'production' system? And using the same user?
sperkmandl
Yes. Btw, this failure occurs on a Window 7 x64 box.
After creating a SR, Oracle support recognized it as a Microsoft bug still to be solved (Bug 9373409).
Suggested workaround: disable out Of Band Breaks (OOB) from java as -Doracle.net.disableOob=true, (whatever this means), or use OCI driver or use dedicated connections.

I still wonder why I couldn't find any real info after googling around for the text error in the subject.
Found hits deal with connection context, while the actual problem is "Bug 9373409: SUDDENLY JDBC THIN GOT CONNECTION ABORT ERROR ONLY WINDOWS 2008 OR VISTA ENV"
sperkmandl wrote:
Yes. Btw, this failure occurs on a Window 7 x64 box.
After creating a SR, Oracle support recognized it as a Microsoft bug still to be solved (Bug 9373409).
Suggested workaround: disable out Of Band Breaks (OOB) from java as -Doracle.net.disableOob=true, (whatever this means), or use OCI driver or use dedicated connections.

I still wonder why I couldn't find any real info after googling around for the text error in the subject.
Found hits deal with connection context, while the actual problem is "Bug 9373409: SUDDENLY JDBC THIN GOT CONNECTION ABORT ERROR ONLY WINDOWS 2008 OR VISTA ENV"
That last suggests a real possibility...those OSes introduced IPv6 in a significant way. There have been other problems with that.
1 - 9
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 24 2010
Added on Nov 24 2010
9 comments
10,109 views