Oracle database version 12.1.0.2
Java version – Openjdk version 1.8.0_222
Linux 3.10.0-1062.1.2.el7.x86_64
Web user reported getting an intermittent connection reset error from the web application. Web error shows the following:
Connection reset, at oracle.jdbc.driver.SQLStateMapping.newSQLException
The database is Oracle 12c and the following is logged in the database alertXXXX.log file:
WARNING: inbound connection timed out (ORA-3136)
After a lot of testing and investigation, it turned out that the issue is related to the Linux web server’s random number generator. Oracle needs a random number generated to keep its connection open. The headless Linux web server was not generating the random number fast enough and that caused the connection to be closed between Java and Oracle.
The easiest solution is to add this parameter to the java launch command:
-Djava.security.egd=file:/dev/./urandom
Another solution is to update the java.security file and change the “securerandom.source” parameter to “/dev/urandom”.
This link gives a detailed explanation of the problem:
Oracle 11g JDBC driver hangs blocked by /dev/random – entropy pool empty