Socket Read Timed Out Error Trying To Connect From JDBC Application (Doc ID 2051087.1)
Socket Read Timed Out Error Trying To Connect From JDBC Application (Doc ID 2051087.1)
"Socket read timed out" Error Trying to Connect from JDBC Application (Doc ID
2051087.1)
In this Document
Symptoms
Cause
Solution
References
APPLIES TO:
SYMPTOMS
JDBC database connections using a driver earlier than 12.1.0.2 fail with a "Socket read timed out" error, such as the
one listed in the following exception stack:
With a limited number of JDBC connections (such as a single, small JDBC or UCP connection pool), the application
works successfully.
With a high number of JDBC connections, the "IO Error: Socket read timed out" error occurs.
CAUSE
Specifically, the problem occurs if the DNS service is in maintenance mode. This may occur if, for example, there is a
syntax error in the DNS main configuration file / the NTS file.
The listener must perform a DNS query with each incoming (JDBC thin) client connection, and if DNS response is slow
or unresponsive for any reason, all incoming client connections through the listener may be affected or delayed. This
can cause "Socket read timed out" errors as in the case where the DNS is in maintenance mode instead of active mode
during the time of failure.
SOLUTION
1 of 2 04/06/2024, 09:27
Document 2051087.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-st...
Make sure the DNS service is up and running. If necessary, correct any syntax errors (such as in the NTS file) and bring
the DNS service back online.
Note: There is an enhancement in the JDBC driver with Patch:18369949 where the client modifies the connection
properties to lessen this DNS dependency at the listener. This patch changes the connect string to use the IP
address instead of the hostname, eliminating the need to go through the DNS service for name resolution. This
improved JDBC connection behavior takes effect starting with Oracle 12.1.0.2.0, but the same enhancement can
also be obtained with patch:18369949 on top of JDBC 11.2.0.3 or 11.2.0.4. This prevents any future connection
delays due to the DNS service being slow or unresponsive for any reason.
REFERENCES
2 of 2 04/06/2024, 09:27