IBM Data Server Client Version 9.7 Issue

Posts   
 
    
dazedorconfused avatar
Posts: 89
Joined: 06-Apr-2006
# Posted on: 31-May-2011 20:33:01   

I recently upgraded several components of one of my applications that uses LLBLGen Pro.

Upgrades were as follows: -Database server upgraded from DB2 7.1 on 32 bit AIX to DB2 9.7.3 on 64 bit AIX -Uninstalled DB2 runtime client lite 8.x on my dev machine -Installed IBM Data Server Client 9.7 on my dev machine -Installed LLBLGen Pro 3.1 on my dev machine -Upgraded my LLBLGen Pro project from 2.6 format to 3.1 format -Successfully connected to and refreshed relational model data from the database -Successfully generated source code -Changed target framework for all projects in the solution to 4.0 -Successfully compiled and ran my application

However, the first time the application attemts to connect to the database, a System.TypeInitializationException is thrown.

**Message: **The type initializer for 'SD.LLBLGen.Pro.DQE.DB2.DynamicQueryEngine' threw an exception.

The inner exception, a System.ArgumentException, reveals the following:

**Message: **Unable to find the requested .Net Framework Data Provider. It may not be installed.

**Stack Trace: ** at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) at SD.LLBLGen.Pro.ORMSupportClasses.DbProviderFactoryInfo.get_FactoryToUse() in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.1\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Persistence\DbProviderFactoryInfo.cs:line 183 at SD.LLBLGen.Pro.ORMSupportClasses.DbProviderFactoryInfo.get_FactoryForReflection() in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.1\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Persistence\DbProviderFactoryInfo.cs:line 216 at SD.LLBLGen.Pro.ORMSupportClasses.DbProviderFactoryInfo.InitializeEnumTypeCache() in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.1\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Persistence\DbProviderFactoryInfo.cs:line 137 at SD.LLBLGen.Pro.ORMSupportClasses.DbProviderFactoryInfo.SetDbProviderFactoryParameterData(String dbProviderFactoryInvariantName, String dbProviderSpecificEnumTypeName, String dbProviderSpecificEnumTypePropertyName) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.1\Frameworks\LLBLGen Pro\RuntimeLibraries\ORMSupportClasses\Persistence\DbProviderFactoryInfo.cs:line 92 at SD.LLBLGen.Pro.DQE.DB2.DB2SpecificCreator.SetDbProviderFactoryParameterData(String dbProviderFactoryInvariantName, String dbProviderSpecificEnumTypeName, String dbProviderSpecificEnumTypePropertyName) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.1\Frameworks\LLBLGen Pro\RuntimeLibraries\DB2DQE\DB2SpecificCreator.cs:line 81 at SD.LLBLGen.Pro.DQE.DB2.DynamicQueryEngine..cctor() in c:\Myprojects\VS.NET Projects\LLBLGen Pro v3.1\Frameworks\LLBLGen Pro\RuntimeLibraries\DB2DQE\DynamicQueryEngine.cs:line 86

The db2 driver, IBM.Data.DB2.dll, version 9.7.0.2 is indeed installed and can be found both in the C:\Program Files\IBM\SQLLIB\BIN\netf20 folder as well as the GAC.

The really wierd thing is that the LLBLGen Pro designer works fine, it can connect and retrieve information from the database. But my application encounters exceptions.

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 31-May-2011 21:05:19   

Does the app.config for the LLBLGen designer application contain any references to the IBM drivers - redirects etc ? You may need to replicate these to the app.config of your application

Matt

dazedorconfused avatar
Posts: 89
Joined: 06-Apr-2006
# Posted on: 31-May-2011 21:10:00   

Further research/tinkering has yielded the following information. If I open the LLBLGen Pro designer using the link that forces it to run on .net 4.0, I get the error below when I try to refresh the relational data:

Exception information.

LLBLGen Pro version: v3.1. Build: April 14th, 2011

Exception details:

Message: Unable to find the requested .Net Framework Data Provider. It may not be installed. Source: System.Data Stack trace: at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) at SD.LLBLGen.Pro.DBDriverCore.DBDriverBase.GetDbProviderFactory() at SD.LLBLGen.Pro.DBDriverCore.DBDriverBase.CreateConnection() at SD.LLBLGen.Pro.Gui.Controls.WizardPages.MetaDataRetrievalWizard_Step_ConnectionData.TestConnectionData()

Inner exception: <null>

So, it seems that I may not be able to upgrade my application to use the 4.0 framework!

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 31-May-2011 21:17:26   

So does your application work if compiled against a lower version of the .Net framework ?

Matt

dazedorconfused avatar
Posts: 89
Joined: 06-Apr-2006
# Posted on: 31-May-2011 21:24:35   

Indeed. I just changed everything to target 3.5 and I am back in business.

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 31-May-2011 22:43:17   

So it looks like the IBM driver is built against 3.5 as well. Are you happy with this a solution for the moment ?

Matt

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39859
Joined: 17-Aug-2003
# Posted on: 01-Jun-2011 09:33:34   

This is likely caused by the fact that the IBM client software didn't install an entry in .NET 4.0's machine.config file for dbproviderfactories. Please check that (the file is located in the .NET 4.0 config folder in Windows\Microsoft.NET ) and if needed, create it.

Frans Bouma | Lead developer LLBLGen Pro
dazedorconfused avatar
Posts: 89
Joined: 06-Apr-2006
# Posted on: 01-Jun-2011 16:47:44   

All that was in 4.0's machine.config file was

<add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>

So I copied the following from the machine.config file in the v2.0.50727 folder to 4.0's machine.config file.

<add name="IBM DB2 .NET Data Provider" invariant="IBM.Data.DB2" description="IBM DB2 Data Provider for .NET Framework 2.0" type="IBM.Data.DB2.DB2Factory, IBM.Data.DB2, Version=9.0.0.2, Culture=neutral, PublicKeyToken=7c307b91aa13d208" />

<add name="IBM Informix .NET Data Provider" invariant="IBM.Data.Informix" description="IBM Informix Data Provider for .NET Framework 2.0" type="IBM.Data.Informix.IfxFactory, IBM.Data.Informix, Version=9.0.0.2, Culture=neutral, PublicKeyToken=7c307b91aa13d208" />

<add name="IBM DB2 .NET Data Provider 9.7.0" invariant="IBM.Data.DB2.9.7.0" description="IBM DB2 Data Provider 9.7.0 for .NET Framework 2.0" type="IBM.Data.DB2.DB2Factory, IBM.Data.DB2.9.7.0, Version=9.7.0.2, Culture=neutral, PublicKeyToken=7c307b91aa13d208" />

<add name="IBM Informix .NET Data Provider 9.7.0" invariant="IBM.Data.Informix.9.7.0" description="IBM Informix Data Provider 9.7.0 for .NET Framework 2.0" type="IBM.Data.Informix.IfxFactory, IBM.Data.Informix.9.7.0, Version=9.7.0.2, Culture=neutral, PublicKeyToken=7c307b91aa13d208" />

I then ran LLBLGen Pro 3.1 using the force .Net 4.0 link and was able to connect to the database successfullly. Thanks Frans!!