There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
francis
Posts: 18
Joined: Tue 23 Dec 2014 21:13

There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by francis » Thu 10 Sep 2020 22:07

Hi,

I have a large native query that returns many bigint(x) columns on a MySQL 5.7 db.

I run it with context.Database.SqlQuery<MyCustomClass>(query).ToList();

Accoring to this link https://www.devart.com/dotconnect/mysql ... pping.html, the only type that gets concerted to SByte is tinyint, but when I run the query in dbForge Studio, I do not get any rows as tinyint. I get int, uint, bigint(1 to 11).

Why am I getting this werror and how can I debug this? The only error I get is this, but I have a large query with ~70 columns so how can I figure out which column is the offender?

System.NotSupportedException: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'.
at System.Data.Entity.SqlServer.SqlProviderManifest.GetStoreType(TypeUsage edmType)
at System.Data.Entity.ModelConfiguration.Edm.Services.StructuralTypeMappingGenerator.MapTableColumn(EdmProperty property, String columnName, Boolean isInstancePropertyOnDerivedType)
at System.Data.Entity.ModelConfiguration.Edm.Services.PropertyMappingGenerator.Generate(EntityType entityType, IEnumerable`1 properties, EntitySetMapping entitySetMapping, MappingFragment entityTypeMappingFragment, IList`1 propertyPath, Boolean createNewColumn)
at System.Data.Entity.ModelConfiguration.Edm.Services.TableMappingGenerator.Generate(EntityType entityType, DbDatabaseMapping databaseMapping)
at System.Data.Entity.ModelConfiguration.Edm.Services.DatabaseMappingGenerator.GenerateEntityTypes(DbDatabaseMapping databaseMapping)
at System.Data.Entity.ModelConfiguration.Edm.Services.DatabaseMappingGenerator.Generate(EdmModel conceptualModel)
at System.Data.Entity.DbModelBuilder.Build(DbProviderManifest providerManifest, DbProviderInfo providerInfo)
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.LazyInternalContext.get_ObjectContext()
at System.Data.Entity.Internal.InternalContext.ExecuteSqlQuery[TElement](String sql, Nullable`1 streaming, Object[] parameters)
at System.Data.Entity.Internal.InternalContext.ExecuteSqlQueryAsIEnumerator[TElement](String sql, Nullable`1 streaming, Object[] parameters)
at System.Data.Entity.Internal.InternalContext.ExecuteSqlQuery(Type elementType, String sql, Nullable`1 streaming, Object[] parameters)
at System.Data.Entity.Internal.InternalSqlNonSetQuery.GetEnumerator()
at System.Data.Entity.Infrastructure.DbRawSqlQuery`1.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)

francis
Posts: 18
Joined: Tue 23 Dec 2014 21:13

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by francis » Thu 10 Sep 2020 22:31

This results in the same error, so it's not the query:
context.Database.SqlQuery<MyCustomClass>("SELECT firstname FROM people LIMIT 1").ToList()

class MyCustomClass
{
public string FirstName { get; set; }
}

Could it be it the model itself? One of the 30 tables has many tinyint fields which got mapped to sbyte by EntityDeveloper. But it can't be that: many classes have SByte properties, and I've been using that model for years with Devart.

I have no clue where to go from here.

Shalex
Site Admin
Posts: 9077
Joined: Thu 14 Aug 2008 12:44

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by Shalex » Fri 11 Sep 2020 17:54

Try opening your *.edml model with XML Editor and look for SByte entries.

francis
Posts: 18
Joined: Tue 23 Dec 2014 21:13

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by francis » Fri 11 Sep 2020 18:50

There are 132 of them, in many classes (there are 92 EntityTypes) I've been using without errors for years. I recently added a few more classes (with yet more SBytes) for this project and now the model dies. What should I do?

I cannot modify the tables for legacy reasons.

Shalex
Site Admin
Posts: 9077
Joined: Thu 14 Aug 2008 12:44

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by Shalex » Tue 15 Sep 2020 14:13

francis wrote:
Thu 10 Sep 2020 22:07
System.NotSupportedException: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'.
at System.Data.Entity.SqlServer.SqlProviderManifest.GetStoreType(TypeUsage edmType)
[...]
That is a stack trace of a different provider that talks to SQL Server instead of MySQL.

Please send us a small test project with the corresponding DDL/DML script so that we can reproduce the error in our environment.


francis
Posts: 18
Joined: Tue 23 Dec 2014 21:13

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by francis » Fri 18 Sep 2020 16:10

Is anyone working on this? Did you receive my repro solution?

francis
Posts: 18
Joined: Tue 23 Dec 2014 21:13

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by francis » Mon 21 Sep 2020 17:01

I think it's a bug in Context.Database.Initialize() because the error source is "EntityFramework.SqlServer" but I do not use sqlserver anywhere. It's not even installed. I only use mysql.

Model edml file starts with:

<edmx:Edmx Version="3.0" xmlns:edmx="http://schemas.microsoft.com/ado/2009/11/edmx">
<!-- EF Runtime content -->
<edmx:Runtime>
<!-- SSDL content -->
<edmx:StorageModels>
<Schema Namespace="Database.C2.Entities.Store" Alias="Self" Provider="Devart.Data.MySql" ProviderManifestToken="MySQL, 5.7.20" xmlns:store="http://schemas.microsoft.com/ado/2007/1 ... aGenerator" xmlns:devart="http://devart.com/schemas/edml/StorageS ... nsions/1.0" xmlns="http://schemas.microsoft.com/ado/2009/11/edm/ssdl">

Meanwhile, if there is an alternate way to send manual queries through your library please let me know.

Shalex
Site Admin
Posts: 9077
Joined: Thu 14 Aug 2008 12:44

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by Shalex » Tue 22 Sep 2020 16:30

Thank you for the test project. We have reproduced the issue and are investigating it. We will notify you about the result.

Shalex
Site Admin
Posts: 9077
Joined: Thu 14 Aug 2008 12:44

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by Shalex » Thu 24 Sep 2020 09:19

The current implementation of dotConnect for MySQL includes two sets of assemblies with the same names and versions:

1) the .NET Framework Devart.* assemblies which are shipped with installation:
* assemblies are created in C:\Program Files (x86)\Devart\dotConnect\MySQL\ , GAC 2.0 (C:\Windows\assembly\GAC_MSIL\), GAC 4.0 (C:\Windows\Microsoft.NET\assembly\GAC_MSIL\)
* licensing approach is described at https://www.devart.com/dotconnect/mysql ... nsing.html

2) the .NET Standard (.NET Core) Devart.* assemblies which are available via NuGet:
* you can download packages from https://www.nuget.org/packages/devart.data.mysql.ef6
* licensing approach is described at https://www.devart.com/dotconnect/mysql ... ndard.html
There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'.
You mixed up .NET Framework and .NET Standard Devart.* assemblies in your solution. You should use only one set of them (do not mix).

Are you going to work with .NET Framework or .NET Core application?

* With .NET Framework, the EF6 provider registration should be placed in *.config file of startup application (not DAL assembly).
* With .NET Core, the EF6 provider registration is different: https://www.devart.com/dotconnect/mysql ... ovideref63.

Refer to https://blog.devart.com/entity-framewor ... pport.html.

francis
Posts: 18
Joined: Tue 23 Dec 2014 21:13

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by francis » Fri 25 Sep 2020 17:37

Hi,

In production, I only use Framework 4.8 and I never use the GAC. I recreated a repro with .net 4.8. Same result.

I have been using the same solution for many years (14 or so). This error just started appearing 2 weeks ago. I need a resolution asap.

I am unable to send you the repro by email because gmail, in its infinite wisdom, does not allow zip attachments. Please provide a way for me to upload it to you. (but not here on a public forum)

francis
Posts: 18
Joined: Tue 23 Dec 2014 21:13

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by francis » Thu 01 Oct 2020 21:46

Guys,

This is terrible service.

Shalex
Site Admin
Posts: 9077
Joined: Thu 14 Aug 2008 12:44

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by Shalex » Fri 02 Oct 2020 09:47

We didn't receive your updated test project. Please upload it to some file exchange server (e.g.: www.dropbox.com) and send us the download link via our contact form.

francis
Posts: 18
Joined: Tue 23 Dec 2014 21:13

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by francis » Fri 09 Oct 2020 17:58

Another week without a response. This is atypical from Devart. I've been a client for years but this worries me about your company.

I still get errors refering to SqlServer but there is nothing referring to SqlServer anywhere: I strictly use MySQL. Iadded a defaultConnectionFactory to make sure EF6 doesn't try to load SqlServer by default but it didn't help.

"An unhandled exception of type 'System.InvalidOperationException' occurred in EntityFramework.dll
The store type 'enum' could not be found in the SqlServer provider manifest"


Here you can replace 'enum' with many other types not supported by SqlServer. Why is the library loading SqlServer? There is not a single reference to "SqlServer" in the entire code base.

using (Database.Entities.Context context = new Database.Entities.Context("mydb"))
{
context.Database.Initialize(true); --> Exception
}

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<connectionStrings>
<add name="mydb" connectionString="server=localhost;user id=me;password=pw;database=mytable;charset=utf8;unicode=True;FoundRows=true;" providerName="Devart.Data.MySql" />
</connectionStrings>
<system.data>
<DbProviderFactories>
<remove invariant="Devart.Data.MySql" />
<add name="dotConnect for MySQL" invariant="Devart.Data.MySql" description="Devart dotConnect for MySQL" type="Devart.Data.MySql.MySqlProviderFactory, Devart.Data.MySql" />
</DbProviderFactories>
</system.data>
<entityFramework>
<defaultConnectionFactory type="Devart.Data.MySql.Entity.MySqlConnectionFactory, Devart.Data.MySql.Entity.EF6" />
<providers>
<provider invariantName="Devart.Data.MySql" type="Devart.Data.MySql.Entity.MySqlEntityProviderServices, Devart.Data.MySql.Entity.EF6" />
</providers>
</entityFramework>
</configuration>

Shalex
Site Admin
Posts: 9077
Joined: Thu 14 Aug 2008 12:44

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by Shalex » Mon 12 Oct 2020 17:26

francis wrote:
Fri 09 Oct 2020 17:58
"An unhandled exception of type 'System.InvalidOperationException' occurred in EntityFramework.dll
The store type 'enum' could not be found in the SqlServer provider manifest"


Here you can replace 'enum' with many other types not supported by SqlServer. Why is the library loading SqlServer? There is not a single reference to "SqlServer" in the entire code base.
SqlServer is included in the EntityFramework NuGet package and is used by the EF engine as a default provider.
francis wrote:
Fri 25 Sep 2020 17:37
In production, I only use Framework 4.8 and I never use the GAC. I recreated a repro with .net 4.8. Same result.
Please upload your updated solution, that uses only .NET Framework Devart.* assemblies shipped with the provider installation, to some file exchange server (e.g.: www.dropbox.com) and send us the download link via our contact form.

Post Reply