Re: java.net.SocketException: Software caused connection abort: recv failed
Posted by: Claudio Gangemi
Date: July 23, 2007 09:06AM

I experienced problems when I try to create in java a lot of threads (more than 100) which act simoultaneously on a database.
My machine has installed WinXP and MySQL 4.1.
I have also tried to install MySQL in the same machine where my java application runs (that is, I connect to localhost), because at the beginning I have thought that it was due to network problems, but also in this case I have received the same message.
I have configured MySQL with max_connection=1900 and in the wizard I have configured MySQL to work like a Database server.
I receive the error I report here when one of my threads try to connect to the database.
That does not happen with a smaller number of threads, e.g. 20.


** BEGIN NESTED EXCEPTION **

com.mysql.jdbc.CommunicationsException
MESSAGE: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: Software caused connection abort: recv failed

STACKTRACE:

java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1953)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2368)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2867)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:870)
at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3333)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1232)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2749)
at com.mysql.jdbc.Connection.<init>(Connection.java:1553)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at mySQLconnector.dbConnect(mySQLconnector.java:12)
at dbAdder.run(dbAdder.java:21)
at java.lang.Thread.run(Unknown Source)


** END NESTED EXCEPTION **


Any idea?

Thanks for your help,
Claudio

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.