ORA-29260:network error:TNS lost contact

Hi Experts,

i'm using utl_tcp in my code to open a connection then i enter the username and password, i put a loop in my code so i can send the commands to this connection using oracle pipes, but some times i got this error message, ORA-29260:network error:TNS lost contact, please i appreciate if some one tell me what is the problem is it a connection problem or a bug in utl_tcp package.

part of the code
.....
c := UTL_TCP.open_connection (remote_host=> Pipaddress,
remote_port=> Pportnumber,
CHARSET => 'US7ASCII');

-- login
ret_val := UTL_TCP.write_line (c,'LOGIN:' || Puser|| ',' || Ppass|| ';');
.........
LOOP
.........
RESULT := DBMS_PIPE.RECEIVE_MESSAGE (p_name);
DBMS_PIPE.UNPACK_MESSAGE (his_msg_cmd);
DBMS_PIPE.UNPACK_MESSAGE (his_msg_params);
.........
ret_val := UTL_TCP.write_line (c, his_msg_cmd || ':' || his_msg_params || ';');
.........
END LOOP;
.........
ret_val := UTL_TCP.write_line (c, 'LOGOUT:;');
UTL_TCP.close_connection (c);
........
END;
LVL 9
DrAskeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DLyallCommented:
A possible cause is given below.

Applies to: PL/SQL - Version: 8.1.6.0.0
This problem can occur on any platform.
SymptomsUsing UTL_TCP implementing a sort of FTP Client gives during runtime following error:

ORA-29260: network error: TNS:lost contact
CauseThe error ORA-29260 occurs in most cases when a firewall is blocking a set of ports

SolutionContact Network administrator and request to open the blocked port - in case of FTP protocol port 21 should be opened.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


0
DrAskeAuthor Commented:
Thanx for reply,

sometimes the command works successfully -and I get response from the server- and sometimes doesn't!!
I don't think the problem in the firewall.
0
rbrookerCommented:
Hi,

just harping on about the firewall bit, the firewall we have here between dev and prod allows connections through on specific ports from ip's etc, but also goes one step further.  if there has been no activity on a connection for about an hour, then the connection is destroyed.  could this be happening to you?

what about tcp timeouts?

good luck :)
0
schwertnerCommented:
Surprisingly sometimes change of the network card helps.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.