Migrating oracle driver to v12

Posts   
 
    
methodman
User
Posts: 194
Joined: 24-Aug-2009
# Posted on: 02-Sep-2015 23:45:55   

Hello there,

I'm trying to migrate my web application to oracle's managed driver.

My setup:

LLBLGen 4.2 .NET Framework 4.5

Here is what I did:

  1. Downloaded the zip file
  2. Referenced Oracle.ManagedDataAccess.dll in my web app project. (dll gets copied to the bin folder)
  3. Added this to my web.config
<system.data>
    <DbProviderFactories>
      <!--Remove in case this is already defined in machine.config-->
      <remove invariant="Oracle.DataAccess.Client" />
      <add name="Oracle Data Provider for .NET"
          invariant="Oracle.DataAccess.Client"
          description="Oracle Data Provider for .NET, Managed Driver"
          type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </DbProviderFactories>
  </system.data>

The version 4.121.2.0 matches.

  1. Copied the default tnsnames.ora into the bin directory.

After a rebuild I launch the app and it's giving me this error

Could not load type 'Oracle.DataAccess.Client.OracleDbType' from assembly 'Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342'.

Stacktrace

   v System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)
   v System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
   v System.Reflection.Assembly.GetType(String name, Boolean throwOnError)
   v SD.LLBLGen.Pro.ORMSupportClasses.DbProviderFactoryInfo.InitializeEnumTypeCache()
   v SD.LLBLGen.Pro.ORMSupportClasses.DbProviderFactoryInfo.SetDbProviderFactoryParameterData(List`1 dbProviderFactoryInvariantNamesWithEnumTypeNames, String dbProviderSpecificEnumTypePropertyName)
   v SD.LLBLGen.Pro.DQE.Oracle.OracleSpecificCreator.SetDbProviderFactoryParameterData(List`1 dbProviderFactoryInvariantNamesWithEnumTypeNames, String dbProviderSpecificEnumTypePropertyName)
   v SD.LLBLGen.Pro.DQE.Oracle.DynamicQueryEngine..cctor()

Am I Missing something here ?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 03-Sep-2015 07:30:12   

Did you install ODP.Net client on your machine? I don't think you need that providerFactory explanation in your .config. By default the managed driver is chosen first, if available.

David Elizondo | LLBLGen Support Team
methodman
User
Posts: 194
Joined: 24-Aug-2009
# Posted on: 03-Sep-2015 08:48:56   

I was following the instructions in this thread

https://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=22573

Also I have installed the older unmanaged version on my PC. Thus I thought that config section would prefer the new managed provider.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 03-Sep-2015 16:07:27   

Be sure to use .NET 4 or higher, as the managed provider needs .net 4 or higher. Also, as you have defined the factory there, the dll has to be reachable by .net, so it either has to be in the gac or local to the app...

Frans Bouma | Lead developer LLBLGen Pro