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