0% found this document useful (0 votes)
150 views2 pages

Socket Read Timed Out Error Trying To Connect From JDBC Application (Doc ID 2051087.1)

sock error solution
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
150 views2 pages

Socket Read Timed Out Error Trying To Connect From JDBC Application (Doc ID 2051087.1)

sock error solution
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Document 2051087.1 https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-st...

Copyright (c) 2024, Oracle. All rights reserved. Oracle Confidential.

"Socket read timed out" Error Trying to Connect from JDBC Application (Doc ID
2051087.1)

In this Document

Symptoms
Cause
Solution
References

APPLIES TO:

JDBC - Version 11.2.0.1.0 to 12.1.0.1.0 [Release 11.2 to 12.1]


Universal Connection Pool - Version 11.2.0.1.0 to 12.1.0.1.0 [Release 11.2 to 12.1]
Oracle WebLogic Server - Version 10.3.6 to 10.3.6
Information in this document applies to any platform.

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:

org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection;


nested exception is java.sql.SQLException: Exception occurred while getting connection:
oracle.ucp.UniversalConnectionPoolException: Cannot get Connection from Datasource:
java.sql.SQLRecoverableException: IO Error: Socket read timed out

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

The issue is caused by DNS configuration/setup.

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

NOTE:1449843.1 - Reducing Client Connection Delays When DNS Is Unresponsive


NOTE:1117096.1 - Why Does a Failed JDBC/Thin Connection Sometimes Fail with a "The Network Adapter could not
establish the connection" Exception and Other Times Fail with a "Socket read timed out" Exception?
Didn't find what you are looking for?

2 of 2 04/06/2024, 09:27

You might also like