Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Created Unassigned: SqlProviderServices.ValidateVersionHint should avoid throwing when possible [1113]

$
0
0
When EF6 is used with an EDMX which contains an SSDL Schema element with a ProviderManifestToken=2005, the call to BufferedDataReader.ReadMetadata() will handle a ProviderIncompatibleException due to the provider manifest token value being less than 2008 and the BufferedDataReader making an attempt to obtain a Spatial Data Reader to interpret the metadata. The issue comes when the SQL Server provider services validates the version hint (method SqlProviderServices.ValidateVersionHint()) and based on that it determines that it is incompatible with spatial data types, regardless of the actual version of SQL server that's being used. Note this happens even in models that do not contain spatial data types.

This is a first chance exception, but it is costly given that an application runs into it on every single query that is executed. It is the customer's responsibility to update their EDMX accordingly to their environment, but if there's a way to override this value with the actual version of SQL Server that's being used (under very controlled circumstances) then we should do it and allow the application to run faster.

An alternative would also be to only request the Spatial Data Reader when the query is expected to materialize spatial types. This may or may not be possible to detect at this stage of the query, but it may be worth exploring since this issue is generic to all providers that may or may not support spatial data types.

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>