Skip to Main Content
  • Questions
  • Oracle.DataAccess.Client.OracleException ORA-03135: connection lost contact

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Shiva.

Asked: April 27, 2009 - 5:20 pm UTC

Last updated: June 03, 2025 - 1:36 am UTC

Version: 10.2.0

Viewed 10K+ times! This question is

You Asked

I am using the following
IIS Server for App server.
ODP.Net
Oracle 10.2.0

After 30 minutes of idle time i get the error ORA-03135: connection lost contact.
The Error is same even if I use Sql*plus.
I asked the network group to increase firewall to 4 hours which they did increase it on port 1521.

I am not sure of the return ports time out values can be set.

Since it¿s a web service on IIS, the w3w.exe opens an active connection and we have default settings on connection pooling, so one connection is maintained.
After 30 minutes idle on the next call, I get the error. I tried the same with Sql*plus and I do get the same error.

Is there a way or work around for the same?

Appreciate your help.

and Tom said...

this is a firewall issue, you might be able to 'work around it' by having the server 'ping' the client - by setting the expire_time in the sqlnet.ora on the server

http://docs.oracle.com/cd/B19306_01/network.102/b14213/sqlnet.htm#sthref479

but bear in mind, the network guys enabled time out for a reason (security). By 'pinging' like this, you are in effect 'working around' their rule. You may find that this solution could be in violation of your company policy - so, I would suggest you check that out before enabling this.

Rating

  (7 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

ORA-03135: in 11gR1

Rajeshwaran, Jeyabal, September 08, 2010 - 12:27 pm UTC

Tom:

We are using 11gR1 (11.1.0.6.0) client to connect with Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 server.

When connecting to the server from my machine, I am facing this below error if my connection is idle for 7 min's

rajesh@10GR2> select * from dual;
select * from dual
*
ERROR at line 1:
ORA-03135: connection lost contact
Process ID: 0
Session ID: 130 Serial number: 21071


ERROR:
ORA-03114: not connected to ORACLE

But however the same is not happening with my colleague machine connecting to the same Oracle server using the same 11gR1 (11.1.0.6.0) client and idle for even more than 1 hour. Is that some improper configuration with my machine Tom?

ORA-03135: in 11gR1

Rajeshwaran Jeyabal, November 22, 2010 - 11:22 am UTC

Tom:

Do you have any solution to this problem? I am still facing this issue, because of this i am unable to run long-running Transactions in database. Please help.
Tom Kyte
November 23, 2010 - 1:05 pm UTC

the only time I've seen this is because of a network policy that forced a connection closed after some period of time or some period of inactivity.

If you call a stored procedure that runs for a long time - you will appear "inactive" on your network.

contact your network administrator, I believe you'll find a "time out" policy in place

(or just open a sqlplus session and let it sit for a while - it should time out as well - without doing anything)


did you try the suggestion above? the original answer I gave? you don't say what you have or have not done

ORA-03135: in 11gR1

Rajeshwaran Jeyabal, November 24, 2010 - 1:46 am UTC

Tom:

Basically the DBA is not intrested in setting expire_time in the sqlnet.ora. Since this problem exists only in my machine ( Windows XP professional verson 2002 Service Pack 3) and not with others. I fell that this is a network issue in my machine and working with network Guys.

I believe you'll find a "time out" policy in place

Do you have any idea on how to control this "time out" policy. If yes please help.

Tom Kyte
November 24, 2010 - 9:02 am UTC

I'm not a windows person, especially not on such old software. You have a firewall or some network rule in place that is timing you out - problem is *not* in the oracle software - it is in your network setup somewhere. That would be a place I'm not really qualified in - especially not on an 8 year old windows install.

llll

A reader, November 09, 2017 - 4:20 am UTC

kkk

Khaled, May 29, 2025 - 5:44 pm UTC

Hi,

We have the same situation, we did timeout in firewall for 24h, but my session is closed after 1H, I changed to add expire_time in my sqlnet, now it works, but is it the best solution, or should i investigate more of the issue source?

Thanks Connor for the answer

Khaled, June 03, 2025 - 12:27 pm UTC

Thanks Connor for your reply