Feedback
 
Did this article resolve your question/issue?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025

 


Article

Understanding "Connection Dead" and "Network Operation timed out" errors.

« Go Back

Information

 
Article Number000029398
EnvironmentProduct: Connect for ODBC Oracle Wire Protocol driver
Version: All supported versions
OS: All supported platforms
Database: Oracle
Application: All supported applications
Question/Problem Description
Sometimes it is helpful to understand why the errors "Connection Dead" and "Network Operation timed out" can occur.  When one or both of these errors occur, the cause is not always clear.
Steps to Reproduce
Clarifying Information
Error Message[DataDirect][ODBC Oracle Wire Protocol driver][Oracle]Connection Dead.
[DataDirect][ODBC Oracle Wire Protocol driver][Oracle]Network Operation Timed Out.
Defect/Enhancement Number
Cause
The driver may report one or both of the errors depending on the timeout setting and the usability of the connection.

When the driver detects that the timeout has occurred, it will also try to determine if the connection is still valid and usable.

If the driver determines that the connection is still usable (socket is not closed) then it will report that the network operation has timed out. If the driver determines that the connection is no longer valid, then it will report that the network operation has timed out and also that the connection is dead.

The "connection dead" error can appear by itself if the driver attempts to communicate with the server and discovers that the socket has been closed.

The "connection dead" error can also appear by itself if the host and/or port is incorrect. This can be further confirmed by enabling packet logging with the driver. If the log does not contain any response packets from the server, this is a strong indication that the host and/or port are incorrect.

In the case of just the error "Network Operation timed out", the driver has detected that the timeout has been reached but still considers the connection to be valid and usable.

In the case when seeing both the "Network Operation timed out" and "Connection dead" together, the driver is timing out and also detects that the connection is no longer usable.

The driver determines whether a connection is valid by doing the following:

The driver sends an interrupt to the server to determine whether the connection is valid. The interrupt is used to cancel the current request.

If any of the following are true, then the connection is considered valid and usable:
  • The server replies with a cancel acknowledgement
  • The server replies with a valid response to the original request.
  • If the server has not replied, a simple database operation is performed. The operation is to open and close a  cursor.
Otherwise, the connection is no longer usable and the socket is closed.
Resolution
First, confirm that the host and port details are correct. If so, there are a couple of connect options which may be useful in resolving this issue.

The connect option "Query Timeout" sets number of seconds for the default query timeout for all statements that are created by a connection. If the error is occurring when the server takes a long time to respond to queries, this could resolve the issue.
- If set to -1, the query does not time out. The driver silently ignores the SQL_ATTR_QUERY_TIMEOUT attribute.
- If set to 0, the query does not time out, but the driver responds to the
SQL_ATTR_QUERY_TIMEOUT attribute.
- If set to x (x is the value in seconds), all queries time out after the specified number of seconds unless the application overrides this value by setting the SQL_ATTR_QUERY_TIMEOUT attribute.

The connect option "Failover Mode" may also be useful.
Configure the connect option "AlternateServers" to the same connection if not currently using AlternateServers.
For example, let's say the Oracle listener service is configured on the host "MyServer", port "1521" and ServiceName=ORC_ABC

The AlternateServers property can be configured as follows: 
(HostName=MyServer:PortNumber=1521:ServiceName=ORC_ABC,HostName=MyServer:PortNumber=1521:ServiceName=ORC_ABC,HostName=MyServer:PortNumber=1521:ServiceName=ORC_ABC)

Then set Failover Mode to 1 or 2. 
If set to 1 (Extended Connection), the driver provides failover protection for new and lost
connections, but not any work in progress.
If set to 2 (Select), the driver provides failover protection for new and lost connections. In addition,
it preserves the state of work performed by the last Select statement executed.
Workaround
Notes
References to other documentation:
Progress DataDirect Connect Series for ODBC Version 7.1.6 : Drivers for 32-Bit and 64-Bit Platforms : The Oracle Driver : Connection Option Descriptions
http://media.datadirect.com/download/docs/odbc/allodbc/index.html#page/odbc/Connection_Option_Descriptions_2.html
Attachment 
Last Modified Date9/17/2019 3:14 PM