Forum Stats

  • 3,722,197 Users
  • 2,244,250 Discussions
  • 7,849,702 Comments

Discussions

Howdy, Stranger!

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

creation of new OracleConnection VERY SLOW in VS2008

612071
612071 Member Posts: 8
edited February 2011 in ODP.NET
Hi all,

I've only found one other post regarding this issue with the latest version of the oracle data provider (2.111.6.20) on the Oracle Developer Tools for VS Forum (at: 2488162 Figured I'd post it here to see if anyone else is experiencing problems.

I've got VS2008 with the latest release of ODAC/Developer tools for VS installed and when I try to just create a connection object (i.e. OracleConnection con = new OracleConnection()), it is taking upwards of 45 seconds to create. Obviously this is unsuitable. Is this a known bug? If so, do I need to revert back to older version of OracleDataAccess assembly as stated in the aforementioned post?

I'm really looking for a solution with this version however, as I'm trying to work with some UDTs in Oracle and converting to custom types in .NET and from what I've read, this latest version is the only one that can do so. (correct me if I'm wrong).

Any information is appreciated!

Comments

  • gdarling - oracle
    gdarling - oracle Member Posts: 2,034
    edited June 2008
    I havent heard that one before. Its actually the constructor, not the open()?
    Just out of curiousity, what does this show?
    What platform are you running 11.1.6.20 odp on? with what framework?

    Cheers,
    Greg
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    public class timeit
    {
        public static void Main()
        {
            string strConn = "data source=orcl;user id=scott;password=tiger";
            DateTime start = System.DateTime.Now;
            OracleConnection con = new OracleConnection(strConn);
            DateTime t1 = System.DateTime.Now;
            con.Open();
            DateTime t2 = System.DateTime.Now;
            Console.WriteLine("constructor {0}, open {1}",t1-start, t2-t1);
        }
    }
  • 612071
    612071 Member Posts: 8
    Hi Greg. Indeed, it is the constructor, which seemed very strange to me. But, here's my latest developments... Guess I failed to mention what platforms I was running on, which I'm pretty sure probably had something to do with it. I had a development environment on both a Vista 64-bit, and a Windows Server 2008 (both VMWare virtual machines). Each had two oracle clients installed, both 11g (instant) and 10gR2 (full), as I needed the 10g client for Quest Code tester (entirely different issue!). Anyway, I'm fairly certain that neither of those platforms are officially supported, so most likely my fault.

    I didn't run your test, but I had something similar set up as follows:

    using System;
    using Oracle.DataAccess.Client;
    using System.Diagnostics;

    namespace oratest
    {
    class Program
    {
    static void Main(string[] args)
    {
    Stopwatch sw = new Stopwatch();
    sw.Start();
    OracleConnection con = new OracleConnection();
    sw.Stop();
    TimeSpan ts = sw.Elapsed;
    Console.WriteLine(ts.Seconds.ToString());
    }
    }
    }

    The results printed ranged from 20-45 seconds!!!

    So, I went ahead and created exactly the same setup on a Vista 32-bit virtual machine. Ran the same test and voila, 0 seconds. If your interested, I ran with the ts.Milliseconds.ToString() in the last line and it resulted in 611 milliseconds. So, I've moved my current project development environment to the new Vista 32-bit virtual machine and it seems to be working fine.

    Just as a side bar however, I've also been doing quite a bit of development on a real (non-virtual) 64-bit Vista machine, and the new ODP has been working just fine. But, I have only the 11g client installed on that machine. Could it be confusion between the multiple versions? Platform issues? Both? Don't know myself, but am content enough to work in my new environment.

    Cheers,

    Aaron
  • 572474
    572474 Member Posts: 259
    I am using both VPC and VMWare. Sometime it is slow depend on the resource you left for your Virtual Machine I bet. I have 4 VS 2008 running, 2 in Win XP, 1 in Vista and 1 in Win 2008 (all 32 bit) but so far I have not experience something very slow.

    Ming Man
  • VinceAFW
    VinceAFW Member Posts: 13 Blue Ribbon
    I have a work around for this problem.

    I originally posted this problem on 589639 It only started happening after installed Oracle 11g ODAC 11.1.0.6.21 with Oracle Developer Tools for Visual Studio. I have multiple Oracle homes installed, one for each of the following: Oracle Server Std 8.16, Oracle Server 9.1 Ent, Oracle Server 10gR2, ODT(as per above). I am running on Windows XP SP2. However, this does not matter since the problem only started occurring after installing Oracle 11g ODAC 11.1.0.6.21 with Oracle Developer Tools for Visual Studio.

    I ran the timing example above with the following results:
    constructor 00:00:20.4755089, open 00:00:01.1105891

    After I add the following to the application config file:
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    <configSections>
    </configSections>
    <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
    <assemblyIdentity name="Oracle.DataAccess" publicKeyToken="89B483F429C47342" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-2.111.6.20" newVersion="2.102.2.20"/>
    <publisherPolicy apply="no" />
    </dependentAssembly>
    </assemblyBinding>
    </runtime>
    </configuration>

    I get
    constructor 00:00:01.0947860, open 00:00:00.8914686

    Showing that the problem lies with the Oracle.DataAccess.dll version 2.111.6.20.
  • 442143
    442143 Member Posts: 2
    Guys,

    I had the same problem that you're describing with the 2.111.6.20 version of Oracle.DataAccess.dll that came with ODP.NET 11g and VS2005 on WinXP SP2.

    It was driving me nuts, so I watched what it was doing with filemon. It turns out that it was writing some information to a debug file, C:\documents and settings\alexandrescup\oracle\oradiag_alexandrescup\diag\clients\user_alexandrescup\host_1111091545_11\alert\log.xml , where alexandrescup is my username on the computer.

    The log contained errors:
    Directory does not exist for read/write [C:\app\alexandrescup\product\11.1.0\client_1\log

    I went ahead and created that folder, and it came up with a bunch of other folders that i need to create under log.

    Solution: (works and it's repeatable for me)
    Create C:\app\alexandrescup\product\11.1.0\client_1\log\diag\clients folder.
  • 841473
    841473 Member Posts: 1
    Same problem for me (using latest client, Oracle 11.2.0, Visual Studio 2008, Windows 7)

    I found the "directory does not exist for read/write" errors in sqlnet.log

    Problem solved after creating:

    C:\app\+<username>+\product\11.2.0\client_1\log
    C:\app+\<username>+\product\11.2.0\client_1\log\diag
    C:\app\+<username>+\product\11.2.0\client_1\log\diag\clients
This discussion has been closed.