It works perfect on my local (Windows 10), it only takes 2.5 mins to pump 1 million records from remote Oracle to my local mongo. However, when I tried to run the application from the Linux box, it becomes very slow and after several minutes, I can see the exception "SQLRecoverableException: I/O Exception: Connection reset".
Oracle JDBC driver/JDK1.8 has a bug to generate the random number on some Linux (say Redhat), if the below command cannot return immediately then the issue will happen:
head -n 1 /dev/random
The fix is to set the property or
- Open the
$JAVA_HOME/jre/lib/security/java.security
file in a text editor. - Change the line:
securerandom.source=file:/dev/random
securerandom.source=file:/dev/urandom
http://www.usn-it.de/index.php/2009/02/20/oracle-11g-jdbc-driver-hangs-blocked-by-devrandom-entropy-pool-empty/
https://docs.oracle.com/cd/E13209_01/wlcp/wlss30/configwlss/jvmrand.html
https://stackoverflow.com/questions/6110395/sqlrecoverableexception-i-o-exception-connection-reset
https://community.oracle.com/thread/943911
No comments:
Post a Comment