DB connection timeout

Posted on 2003-03-11
Medium Priority
Last Modified: 2010-08-05
This is the message I got (asp.net)

Exception Details: System.Data.OleDb.OleDbException: ORA-12535: TNS:operation timed out
It happens when trying to open the connection.
The connection is as this: Provider=MSDAORA;User ID=xxx; Password=xxx;Data Source=xxx;
cn.Open() 'error at this line

As it sounds I should increase the timeout time, so I changed the timeout to 200 as follows:
Provider=MSDAORA;User ID=xxx; Password=xxx;Data Source=xxx;connect timeout=200;
And this is the new message I got in the same line cn.open()
Exception Details: System.Data.OleDb.OleDbException: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

The app has been working fine before my office moved to a new floor in the same building. The app still
works for some of the database (use the simular method), but not some of the database. For the ones that do not work, I can still open it from server explore from within the IDE.

Can somebody help?

Question by:GoodJun
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
LVL 28

Expert Comment

ID: 8112079
Try to set your Connection timeout on connection object

cn.ConnectionTimeout = 0 ' 0 for unlimited timeout
LVL 10

Author Comment

ID: 8112233
the cn.ConnectionTimeout is a readonly property. set the timeout to 0 (in the connection string) get the same error message as set 200 seconds.
LVL 28

Expert Comment

ID: 8112726
ConnectionTimeout is not read only property. You can set it during runtime. You are setting it in Connection string. Did you try to set it on connection object instead of connection string?
BTW the same property exists for command object
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

LVL 23

Expert Comment

ID: 8113014
ConnectionTimeout is a READ ONLY property for connection object.

There is no connection time out in Command... It is command time out. there is a big difference between connection time out and command time out.
LVL 10

Author Comment

ID: 8113522
Can anyone explain what I should do to fix the problem. I will add more points for the comments that solve the problem. What can be wrong? it confuses me.
LVL 28

Accepted Solution

iboutchkine earned 375 total points
ID: 8113660
I don't know if it helps you.

Once I've got this error was generated when i was trying to enter null field to a database. When I modified these
fields to 0, error stopped being generated.

That is what I found somewhere

The following are two possible causes of this error:

In the registry, under the key for an OLE DB provider's CLSID, there may be an entry named OLEDB_SERVICES.
If the OLE DB provider being used to make the ADO connection doesn't have the OLEDB_SERVICES entry,
and ADO tries to set up a property that is not supported by the provider, the error occurs.

If OLEDB_SERVICES entry exists but there is a problem in the ADO connection string, the error occurs.

If the OLEDB_SERVICES registry entry is not present, the call to set up a property is made directly
to the provider. If the provider does not support the property, the SetProperties OLE DB call made by
ADO will fail. This is a fatal failure if the property is required in order to make a connection. If
the property was explicitly included in the connection string, it is most likely required.

If the property setting is optional, the failure is not fatal. This is the case when you connect without
explicitly setting the property in the connection string. In this case, ADO sets the property to True
but marks it as optional.

You can work around this problem in the following ways:

Do not use the "Persist Security Info" keyword in your ADO connection string.

Add the OLEDB_SERVICES registry entry as follows:

Start Registry Editor (Regedit.exe).

In the registry under HKEY_CLASSES_ROOT\CLSID, find the CLSID of the OLE DB Provider. For example, the
following registry key is for the Microsoft OLE DB Provider for SQL Server (SQLOLEDB):
Click the CLSID, and then on the Edit menu, click Add Value and add the following registry value:

Data Type: REG_DWORD

NOTE: To find the CLSID for the provider you are using, search for the provider's ProgID (SQLOLEDB,
for example) in the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Classes\. Under the ProgID, there will
be a key named CLSID.
LVL 10

Author Comment

ID: 8113838
I check the registry, the OLEDB_SERVICES key is there with the right value.

The error is when open the connection to database, not in the stage to insert value to database yet.

LVL 28

Expert Comment

ID: 8113891
did you check the statement
"ADO tries to set up property that is not supported by the provider" ???

Just to be sure.
LVL 10

Author Comment

ID: 8114968
If MSDAORA doesn't support timeout, then is there a work around? I can view the database from server explore within the Ide. That makes me think maybe some other settings in asp.net that affects the connection. ? any suggestion?
LVL 10

Author Comment

ID: 8176267
I guess nobody will give more comments to this thread. Ibou, you spend most of the time. I will give the point to you. Thanks nav, I know you are the best in this site.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question