I often get OracleException: Connection request timed out with Oracle Developer Tools for VS 2017 an — oracle-tech

    Forum Stats

  • 3,716,000 Users
  • 2,242,928 Discussions
  • 7,845,734 Comments

Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

I often get OracleException: Connection request timed out with Oracle Developer Tools for VS 2017 an

Lars Pedersen
Lars Pedersen Member Posts: 21
edited April 2018 in ODP.NET

I recently upgraded an Entity Framework app from VS2015 to VS2017.

I have installed Oracle Developer Tools for VS 2017 v12.2.1100.

VS version is: Visual Studio Professional 2017 15.6.6

with:

EntityFramework v6.2.0

Oracle.ManagedDataAccess v12.2.1100

Oracle.ManagedDataAccess.EntityFramework v12.2.1100

Database version: 12.1.0.2.0

Also, Oracle ODAC v.11.2.0.1.0

is installed.   - I have uninstalled this.

The problem is that when I run the program I often get

System.Data.Entity.Core.EntityException: 'The underlying provider failed on Open.'

InnerException: OracleException: Connection request timed out

at the first query in my program:

int operIDToUse = (from o in model.OPERINFOes

                               where o.OSUSER.ToUpper() == System.Environment.UserName.ToUpper() && o.IS_ACTIVE == true

                               select o.OPERID).SingleOrDefault();

I haven't seen the exception when the app is deployed. Also, it seems to go away if I restart the development pc, but then it comes again after rebuilding. It seems to be connected with the

following Intellisense error:

Error 175: The ADO.NET provider with invariant name 'Oracle.ManagedDataAccess.Client' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details. MasterData C:\SS\C#\MasterData\MasterData\OFDModel.edmx

This error appears in the list the first time I build the project after having restarted the pc.

Since it is not a build error, it does not prevent the program from starting, but the above OracleException gets thrown when I run the program.

Answers

  • Lars Pedersen
    Lars Pedersen Member Posts: 21
    edited April 2018

    Thinking it might be because of a connection leak, I added "Pooling=False" to the connection string. But that didn't help.

  • Lars Pedersen
    Lars Pedersen Member Posts: 21
    edited April 2018

    I found out that I also have the same problem described here, but in VS 2017:

    Data source name isn't showing in VS2013 Pro

    For this reason I suspect the existing Oracle components were corrupted after I installed Oracle Developer Tools for Visual Studio 2017.

    I am now trying to uninstall and re-install... however the Oracle Universal Installer seems to hang at "Deinstalling Oracle Data Provider for .NET 11.2.0.3.0":

    Cannot uninstall ODP.NET

  • Lars Pedersen
    Lars Pedersen Member Posts: 21
    edited April 2018

    I got the old components removed and reinstalled.

    Now I am trying to install ODT via Universal installer (using the link For Experienced Developers instead of For Beginners):

    Oracle .NET Software Downloads

    But the installer hangs at "Perform Prerequisite Checks (0%)"... the Cancel button doesn't work either.

  • Lars Pedersen
    Lars Pedersen Member Posts: 21
    edited April 2018

    After restarting the pc the setup was able to finish.

    I now have Developer Tools for VS 2017 installed.

    The Intellisense error has gone away, and I can now open the .edmx file in the designer.

    But after building and running the solution I still get the same connection time out exception.

  • Lars Pedersen
    Lars Pedersen Member Posts: 21
    edited April 2018

    As a test, I tried to create a new EF app.

    But when I try to add a new data model, I get the message:

    "Your project references the latest version of Entity Framework; however, an Entity Framework database provider compatible with this version could not be found for your data connection."

    I finally got past this message but I had to choose packages.config instead of PackageReferences when installing the NuGet package.

    I can now run the new app but I get the same "Connection request timed out" exception as in my original project.

    Curiously, if I move the new project to a different dev pc without Oracle Developer Tools installed, the "Connection request timed out" exception is gone.

    I can also build the project. I get the Intellisense error about a missing Oracle provider but that can just be ignored.

    This shows that the "Connection request timed out" exception is caused by the Oracle installation on my machine and not by settings or program versions inside the Visual Studio project.

  • Lars Pedersen
    Lars Pedersen Member Posts: 21
    edited April 2018

    I have now removed the old versions of ODAC and Oracle Client completely.

    I have also removed an instance of ODP.NET from the GAC using:

    gacutil /u Oracle.ManagedDataAccess

    But it hasn't helped.

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited April 2018

    Does the connection request timeout error occur only for the EF app? Does it occur if you connect via the Oracle Dev Tools or non-EF ODP.NET app?

  • Lars Pedersen
    Lars Pedersen Member Posts: 21
    edited April 2018

    Only EF has the problem, and only on my machine.

    Is it feasible to analyze what causes the connection timeout?

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 2,753 Employee
    edited April 2018

    If it's only happening on your machine and only with EF, I would normally conclude there's a connection configuration issue causing the error. However, it's odd that you don't experience the problem every time you connect. Is there a pattern to when you receive the timeout error?

    One thing you could do is collect an ODP.NET trace (level 7), then see any commonalities that occur before opening a connection.

    Lars Pedersen
  • Lars Pedersen
    Lars Pedersen Member Posts: 21
    edited April 2018

    Thanks. I thought about diagnosing the connection problem, but decided I couldn't afford to spend more time on it.

    So I have reinstalled everything on a fresh dev pc instead.

This discussion has been closed.