Page 1 of 2

Error 'Could not determine storage version'

Posted: Thu 10 Oct 2013 09:23
by svetob@Delen
I recently installed dotConnect for DB2. Everything went fine until I tried to add an .edmx file. When I add the data connection and test it everything seems OK. But as soon as I click on Next> in the Entity Data Model Wizard this error appears:

Image

My GAC has the Devart.Data and Devart.Data.DB2.Entity dlls and when I create an .edml file everything works but I can't use those for this project. Re-installing also didn't work.

I am currently using Entity Framework 5.

Re: Error 'Could not determine storage version'

Posted: Thu 10 Oct 2013 13:00
by Shalex
Please specify the full name of your DB2 server and its exact version.

Re: Error 'Could not determine storage version'

Posted: Thu 10 Oct 2013 13:24
by svetob@Delen
Its a DB2 LUW server version 9.5.10.

And the IBM.Data.DB2 assembly is version 9.0.0.2 if that's relevant.

Re: Error 'Could not determine storage version'

Posted: Fri 11 Oct 2013 07:00
by uross
I have similar problem when using Entity Framework DbContext. If I use DbDevartDB2Command query works. But when using DbContext I get an error:
System.Data.Entity.Core.ProviderIncompatibleException: An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct. ---> System.Data.Entity.Core.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. ---> System.InvalidOperationException: Could not determine storage version; a valid storage connection is required.
I use EF6 RC1 and IBM.Data.DB2 assembly is version 9.7.5.4. DB server version is 9.7.0.7

Re: Error 'Could not determine storage version'

Posted: Fri 11 Oct 2013 12:43
by Shalex
There is a bug in a current public version of dotConnect for DB2 - it requires only the 9.7.4.4 version of IBM.Data.DB2.dll. We will fix the issue in the next public build of dotConnect for DB2 to allow it using any from 9.x and higher versions of IBM.Data.DB2.dll. Our internal build with the fix is available at http://www.devart.com/pub/dcdb2.exe.

Re: Error 'Could not determine storage version'

Posted: Fri 11 Oct 2013 13:26
by svetob@Delen
I updated the dll to version 9.7.4.4 but it is still not working. :/

Re: Error 'Could not determine storage version'

Posted: Fri 11 Oct 2013 15:50
by Shalex
Please post here a detailed call stack of the exception. You can obtain it by connecting from another instance of Visual Studio (2nd) (Debug | Attach to Proccess) to the first VS (where you are adding an .edmx file). Before attaching don't forget to make these settings in your 2nd Visual Studio: a) in the (Debug | Exceptions) window select Common Language Runtime Exceptions; b) in the (Tools | Options) window, Debugging | General - clear Enable Just My Code (Managed Only).

Re: Error 'Could not determine storage version'

Posted: Mon 14 Oct 2013 08:15
by svetob@Delen
Not sure if this is what you wanted:

Call stack
Image
Full Image: http://img812.imageshack.us/img812/2874/pg13.png

Exception Detail
Image
Full Image: http://img5.imageshack.us/img5/2428/iczy.png

Hope this helps!

Re: Error 'Could not determine storage version'

Posted: Mon 14 Oct 2013 08:17
by uross
I tried with your internal build (1.0.110) and now I am getting a different exception:
The 'Instance' member of the Entity Framework provider type 'Devart.Data.DB2.Entity.DB2EntityProviderServices, Devart.Data.DB2.Entity, Version=1.0.110.0, Culture=neutral, PublicKeyToken=09af7300eec23701' did not return an object that inherits from 'System.Data.Entity.Core.Common.DbProviderServices'. Entity Framework providers must inherit from this class and the 'Instance' member must return the singleton instance of the provider. This may be because the provider does not support Entity Framework 6 or later; see http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
I am using Devart.Data.DB2.Entity for EF6.

Re: Error 'Could not determine storage version'

Posted: Tue 15 Oct 2013 09:11
by Shalex
@svetob@Delen
1. Please install http://www.devart.com/pub/dcdb2.exe. Does it help?
2. The behaviour of the new public build of dotConnect for DB2 will be changed: EDM Wizard will show a more detailed error message in case of connecting to unsupported database or using incorrect provider manifest tokens. We are planning to release the build this week. We will notify you when it is available for download.

@uross
Here is an example of registering dotConnect for DB2 in App.config when working with EF6:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <connectionStrings>
    <add name="SAMPLEEntitiesConnectionString" connectionString="User ID=db2admin;Password=db2admin;Server=db2;Database=sample;Persist Security Info=True"
      providerName="Devart.Data.DB2" />
  </connectionStrings>
  <entityFramework>
    <providers>
      <provider invariantName="Devart.Data.DB2" type="Devart.Data.DB2.Entity.DB2EntityProviderServices, Devart.Data.DB2.Entity, Version=1.0.110.6, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </providers>
  </entityFramework>
</configuration>

Re: Error 'Could not determine storage version'

Posted: Tue 15 Oct 2013 13:13
by svetob@Delen
Nope, still doesn't work. Same Error :/

Re: Error 'Could not determine storage version'

Posted: Tue 15 Oct 2013 13:54
by uross
My bad. I forgot to register new version of provider. But now I am getting old exception back. I'll wait for the next release build and try with that.

Re: Error 'Could not determine storage version'

Posted: Fri 18 Oct 2013 11:00
by Shalex
Dear users, please try the new (1.5.118) build of dotConnect for DB2. If the problem persists, specify the exact text of the error with the call stack (it should include a more detailed information now).

Re: Error 'Could not determine storage version'

Posted: Tue 22 Oct 2013 07:07
by uross
I've tried the new build (1.5.118). I get a more detailed exception message now:

Code: Select all

An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct.
   at System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection)
   at System.Data.Entity.Infrastructure.DefaultManifestTokenResolver.<>c__DisplayClass1.<ResolveManifestToken>b__0(Tuple`3 k)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at System.Data.Entity.Infrastructure.DefaultManifestTokenResolver.ResolveManifestToken(DbConnection connection)
   at System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest& providerManifest)
   at System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)
   at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)
   at System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
   at System.Data.Entity.Internal.InternalContext.Initialize()
   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
   at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
   at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
   
   -> INNER EXCEPTION:
    The provider did not return a ProviderManifestToken string.
       at System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection)
       at System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection)
   
       -> INNER EXCEPTION (level 2):
       Unsupported server type 'DB2/LINUXX8664'.
          at Devart.Data.DB2.Entity.ak.a(DB2Connection A_0)
          at Devart.Data.DB2.Entity.DB2EntityProviderServices.GetDbProviderManifestToken(DbConnection connection)
          at System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection connection)
So I guess there is so problem with our server type name.

Re: Error 'Could not determine storage version'

Posted: Tue 22 Oct 2013 12:28
by Shalex
uross wrote:

Code: Select all

       -> INNER EXCEPTION (level 2):
       Unsupported server type 'DB2/LINUXX8664'.
This type of DB2 Server will be supported in the next public build of dotConnect for DB2. We will post here when it is available for download.