Tag Archives: java.sql.SQLRecoverableException: IO Error: Connection reset

Problems of java.sql.sqlrecoveryexception: IO error: connection reset of ojdbc in Linux Environment

To get to the point, the quickest verification method and solution : Java – DJava. Security. EGD = file:///dev/urandom – jar xxxxxx.jar

Describe the following problem: write a jar tool, use the connection pool, ojdbc. The windows environment is all right. Java.sql.sqlrecoveryexception: IO error: connection reset appears after two or three times of startup and shutdown in Linux environment

Check the configuration file and parsing problem, no result

Using the latest ojdbc package, no results

Change Hikari to Druid, no result

I have no choice but to search and find the above scheme, explaining the reason for this problem:

When connecting to the Oracle server, the client needs to generate a random key for client authentication. Under Linux, JDK uses/dev/random by default. Random uses blocking to generate random numbers. The generation speed is very slow, and the Oracle server will reset actively, An error is reported in alert.log:
tns-12535: TNS: operation timed out
ns secondary err Code: 12606
NT main err Code: 0
NT secondary err Code: 0
NT OS err Code: 0
client address: (address = (Protocol = TCP) (host = 192.168.6.21) (Port = 33460))
warning: inbound connection timed out (ora-3136)

Other solutions:

Edit $Java_ Home/JRE/lib/security/Java. Security changes securerandom. Source = file/dev/random to file/dev/random