Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DBProviderFactories.GetFactory("Oracle.DataAccess.Client") very slow

thompkinNov 6 2010 — edited Nov 18 2010

The call to System.Data.Common.DBProvidersFactories.GetFactory("Oracle.DataAccess.Client") is taking over 2 minutes to return on my computer. By comparison, calls to GetFactory() for the System.Data.SqlClient and IBM.Data.DB2 takes less than a second.

Even more strange, the same call is very fast if I am running the code inside of the VS2010 debugger.

ODAC version 11.2.0.1.2 (32bit version)
Windows 7 64 bit
.NET 3.5 SP1
Oracle server - not relevant since test pgm is not connecting to a serve.
Code developed with VS 2010.

Test pgm built with:
- Target CPU=32 (so app runs as 32bit mode, instead of 64)
- Target Framework = .NET 3.5 SP1

The call has not always been this slow. I have been running with ODAC 11.2.0.1.2 since it's release. But, IIRC, the slowness just started several weeks ago.

Below is the test pgm:

Imports System.Configuration
Imports System.Data.Common

Module Module1

    Sub Main()
        CreateFactory("Oracle.DataAccess.Client")
        CreateFactory("System.Data.SqlClient")
        CreateFactory("IBM.Data.DB2")
    End Sub
    Sub CreateFactory(ByVal providerName As String)
        Dim sw = New Stopwatch
        sw.Start()
        Dim factory = DbProviderFactories.GetFactory(providerName)
        sw.Stop()

        If factory Is Nothing Then
            Throw New Exception(String.Format("DbProviderFactories.GetFactory({0}) failed", providerName))
        End If
        Console.WriteLine("DbProviderFactories.GetFactory({0}) call took {1} secs", providerName, sw.Elapsed.TotalSeconds)
    End Sub
End Module

The output I get is:
DbProviderFactories.GetFactory(Oracle.DataAccess.Client) call took 130.1584958 secs
DbProviderFactories.GetFactory(System.Data.SqlClient) call took 0.0001462 secs
DbProviderFactories.GetFactory(IBM.Data.DB2) call took 0.1252213 secs

Please let me know if you need any more information. All help is appreciated.

Jim

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 16 2010
Added on Nov 6 2010
2 comments
1,831 views