Managed ODP.NET driver

Posts   
 
    
Posts: 26
Joined: 11-Apr-2012
# Posted on: 30-Aug-2013 05:31:31   

I was wondering if this driver is supported. I'm trying to use it with my LLBLGEN 3.5 project, but it is not working - I suspect that it is because the factory name may have changed, as is discussed in this thread ? : http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=21624

I'm using this in my app.config now:


<DbProviderFactories>
         <!--Remove in case this is already defined in machine.config--> 
        <remove invariant="Oracle.ManagedDataAccess.Client" />
        <add name="ODP.NET, Managed Driver"
             invariant="Oracle.ManagedDataAccess.Client"
             description="Oracle Data Provider for .NET, Managed Driver"
             type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
      </DbProviderFactories>

I'm getting "The type initializer for 'SD.LLBLGen.Pro.DQE.Oracle.DynamicQueryEngine' threw an exception ...

Any insight would be appreciated.

Thanks

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 30-Aug-2013 08:28:59   

Please post the full exception details (name and stack trace).

David Elizondo | LLBLGen Support Team
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39625
Joined: 17-Aug-2003
# Posted on: 30-Aug-2013 11:34:50   

The Oracle DQE looks for a different factory name. If you change the invariant name to: Oracle.DataAccess.Client

so like this:

<DbProviderFactories>
         <!--Remove in case this is already defined in machine.config-->
        <remove invariant="Oracle.ManagedDataAccess.Client" />
        <add name="ODP.NET, Managed Driver"
             invariant="Oracle.DataAccess.Client"
             description="Oracle Data Provider for .NET, Managed Driver"
             type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
     </DbProviderFactories>

it should find the driver. If Oracle has kept everything the same it should work as-is. Could you test for that please? If not, then we have to look at adding a codepath for this ado.net provider. To be honest I didn't know that this provider was out of beta, though I haven't checked their website lately.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 26
Joined: 11-Apr-2012
# Posted on: 30-Aug-2013 15:30:07   

Alright I have tried that and I'm still getting the same message. I can query the DB ok with the modified invariant when not using the llblgen data access adapter. Here's the stack:


The type initializer for 'SD.LLBLGen.Pro.DQE.Oracle.DynamicQueryEngine' threw an exception. --> at SD.LLBLGen.Pro.DQE.Oracle.DynamicQueryEngine..ctor()
   at MSC_Conversion_Tools._DataAccess.DataAccessAdapter.CreateDynamicQueryEngine() in c:\Users\x\Google Drive\Projects\MS\Conversion Tools\Conversion Tools\_DataAccess\DataAccessAdapter.cs:line 97
   at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.get_FunctionMappings() in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.5\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\AdapterSpecific\DataAccessAdapterBase.cs:line 6113
   at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProvider2.GetDQEFunctionMappings() in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.5\Frameworks\LLBLGen Pro\RuntimeLibraries\LinqSupportClasses\LLBLGenProProvider2.cs:line 197
   at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProviderBase.GetAllFunctionMappings() in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.5\Frameworks\LLBLGen Pro\RuntimeLibraries\LinqSupportClasses\LLBLGenProProviderBase.cs:line 215
   at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProviderBase.HandleExpressionTree(Expression expression) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.5\Frameworks\LLBLGen Pro\RuntimeLibraries\LinqSupportClasses\LLBLGenProProviderBase.cs:line 106
   at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProviderBase.Execute(Expression expression) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.5\Frameworks\LLBLGen Pro\RuntimeLibraries\LinqSupportClasses\LLBLGenProProviderBase.cs:line 92
   at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProProviderBase.System.Linq.IQueryProvider.Execute(Expression expression) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.5\Frameworks\LLBLGen Pro\RuntimeLibraries\LinqSupportClasses\LLBLGenProProviderBase.cs:line 624
   at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProQuery`1.Execute() in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.5\Frameworks\LLBLGen Pro\RuntimeLibraries\LinqSupportClasses\LLBLGenProQuery.cs:line 87
   at SD.LLBLGen.Pro.LinqSupportClasses.LLBLGenProQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.5\Frameworks\LLBLGen Pro\RuntimeLibraries\LinqSupportClasses\LLBLGenProQuery.cs:line 162
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at MSC_Conversion_Tools.ConcRequests.bw_DoWork(Object sender, DoWorkEventArgs e) in c:\Users\x\Google Drive\Projects\MS\Conversion Tools\Conversion Tools\ConcRequests.xaml.cs:line 97

Thanks !

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39625
Joined: 17-Aug-2003
# Posted on: 30-Aug-2013 15:45:31   

No inner exception given?

You defined the factory in the app.config file of your application and the machine.config file doesn't have a definition of ODP.NET defined?

Please post the app.config file (clear the connection string text please, it's a public forum simple_smile )

Frans Bouma | Lead developer LLBLGen Pro
Posts: 26
Joined: 11-Apr-2012
# Posted on: 30-Aug-2013 16:05:53   

Sorry here's the inner exception.


Error loading concurrent requests: The type initializer for 'SD.LLBLGen.Pro.DQE.Oracle.DynamicQueryEngine' threw an exception.System.TypeLoadException: Could not load type 'Oracle.DataAccess.Client.OracleDbType' from assembly 'Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342'.
   at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)
   at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
   at System.Reflection.Assembly.GetType(String name, Boolean throwOnError)
   at SD.LLBLGen.Pro.ORMSupportClasses.DbProviderFactoryInfo.InitializeEnumTypeCache() in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.5\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Persistence\DbProviderFactoryInfo.cs:line 143
   at SD.LLBLGen.Pro.ORMSupportClasses.DbProviderFactoryInfo.SetDbProviderFactoryParameterData(String dbProviderFactoryInvariantName, String dbProviderSpecificEnumTypeName, String dbProviderSpecificEnumTypePropertyName) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.5\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Persistence\DbProviderFactoryInfo.cs:line 92
   at SD.LLBLGen.Pro.DQE.Oracle.OracleSpecificCreator.SetDbProviderFactoryParameterData(String dbProviderFactoryInvariantName, String dbProviderSpecificEnumTypeName, String dbProviderSpecificEnumTypePropertyName) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.5\Frameworks\LLBLGen Pro\RuntimeLibraries\OracleDQE\OracleSpecificCreator.cs:line 101
   at SD.LLBLGen.Pro.DQE.Oracle.DynamicQueryEngine..cctor() in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.5\Frameworks\LLBLGen Pro\RuntimeLibraries\OracleDQE\DynamicQueryEngine.cs:line 91
The thread '<No Name>' (0x1d28) has exited with code 0 (0x0).

My app.config (very simple at this point). I get connection info from tnsnames.


<?xml version="1.0"?>
<configuration>
    <startup>   
      <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
    </startup>
  <system.diagnostics>

    <!--<switches>
      <add name="OracleDQE" value="4"/>
      <add name="ORMGeneral" value="0"/>
      <add name="ORMStateManagement" value="0"/>
      <add name="ORMPersistenceExecution" value="0"/>
      <add name="DefaultSwitch" value="Information"/>
    </switches>-->
    
  </system.diagnostics>
  <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.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </DbProviderFactories>
    </system.data>
</configuration>

The remove invariant statement should clear machine.config correct? Or is that the problem?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39625
Joined: 17-Aug-2003
# Posted on: 31-Aug-2013 12:12:57   

The inner exception suggests the name spaces are different in the assembly you use, so we need a different codepath/build for the DQE. I.o.w.: it's currently not supported.

It's likely not that hard to add though, however we need to look into what else is different as well (like types mapped, features supported).

Is it possible to use the regular ODP.NET (I know, massive install etc....) for the time being?

Frans Bouma | Lead developer LLBLGen Pro
Posts: 26
Joined: 11-Apr-2012
# Posted on: 01-Sep-2013 22:25:04   

Thanks I'll make due for now - here seems to be the differences:

http://docs.oracle.com/cd/E48297_01/doc/win.121/e41125/intro004.htm

It would certainly be nice to have support for - it is so much easier to build with.

Thanks !

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39625
Joined: 17-Aug-2003
# Posted on: 02-Sep-2013 15:39:57   

Thanks for the link simple_smile We'll look into how much is changed and thus how much work it will be. It might very well be very easy (as in a simple compile directive with a couple of lines of code different from the ODPNET one). If that's the case, we'll add it this week. If not, we'll postpone it till v4.1.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 26
Joined: 11-Apr-2012
# Posted on: 04-Sep-2013 23:52:40   

great sounds good, thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39625
Joined: 17-Aug-2003
# Posted on: 05-Sep-2013 13:48:57   

Looks like the XmlType is missing so it requires a different driver build (although small). We'll postpone it to v4.1

Frans Bouma | Lead developer LLBLGen Pro
Posts: 26
Joined: 11-Apr-2012
# Posted on: 26-Sep-2013 16:20:03   

Hi, just for my own timeline purposes, do you have any idea when v4.1 might be released?

Thanks !

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39625
Joined: 17-Aug-2003
# Posted on: 26-Sep-2013 18:26:14   

diamondracer wrote:

Hi, just for my own timeline purposes, do you have any idea when v4.1 might be released?

Thanks !

If things go smoothly, at the end of this year, otherwise early next year.

Frans Bouma | Lead developer LLBLGen Pro
Rana
User
Posts: 11
Joined: 27-Oct-2013
# Posted on: 28-Oct-2013 14:25:20   

I'll second this. The 12c managed driver is 1.9MB! Would be great if we could switch over to this.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39625
Joined: 17-Aug-2003
# Posted on: 28-Oct-2013 16:23:08   

Rana wrote:

I'll second this. The 12c managed driver is 1.9MB! Would be great if we could switch over to this.

We added support for the managed provider in v4.1 beta, which is now available in the customer area for v4.x users simple_smile (both in driver and DQE)

Frans Bouma | Lead developer LLBLGen Pro
Posts: 26
Joined: 11-Apr-2012
# Posted on: 28-Oct-2013 20:09:21   

Sweet thanks, I will try it out !