The Wiert Corner – irregular stream of Wiert stuff

Jeroen Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    20120216-Word-Convert-To-Text

    MPS_6399

    MPS_6398

    More Photos
  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 384 other followers

Archive for September 13th, 2011

Two more FastMM XE2 updates on SourceForge.net in the SVN SCM trunk:

Posted by jpluimers on 2011/09/13

Earlier this week, I wrote about FastMM XE2 update on SourceForge.net in the SVN SCM trunk.

Pierre le Riche has been busy, and got the x64 FullDebugMode working with these two changes to the SourceForge.net: FastMM: SCM:

Needs to be tested, so will do that the upcoming days.

–jeroen

Posted in Delphi, Delphi x64, Development, Software Development | 1 Comment »

Entity Framework: EF4 – update model from database ignores some changes

Posted by jpluimers on 2011/09/13

Almost a year ago there was a post on the MSDN forums titled EF4 – update model from database ignores some changes.

These are the changes it ignores that I found so far:

  • Column renames
  • Column data type changes
  • Changed foreign key relations

Have you found others?

Do which EF versions are worse/better in this respect?

Note that the EF support in Visual Studio 2010 does not warn you if the the model is incompatible with your database.
You will get errors like this at run-time:

System.InvalidOperationException: The 'Size' property on 'ParentEntity' could not be set to a 'Int64' value. You must set this property to a non-null value of type 'Int32'.
   at System.Data.Common.Internal.Materialization.Shaper.ErrorHandlingValueReader`1.GetValue(DbDataReader reader, Int32 ordinal)
   at System.Data.Common.Internal.Materialization.Shaper.GetPropertyValueWithErrorHandling[TProperty](Int32 ordinal, String propertyName, String typeName)
   at lambda_method(Closure , Shaper )
   at System.Data.Common.Internal.Materialization.Shaper.HandleEntityAppendOnly[TEntity](Func`2 constructEntityDelegate, EntityKey entityKey, EntitySet entitySet)
   at lambda_method(Closure , Shaper )
   at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)
   at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()

The workaround is simple but tedious:

  1. check all the errors, (so you need a thorough testing scheme in place)
  2. make a list of all the entities involved
  3. for each entity:
    1. note all the manual changes you did
    2. delete it from the model
    3. add it to the model
    4. re-apply the manual changes you did

–jeroen

Posted in .NET, Database Development, Development, EF Entity Framework, Software Development | 1 Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 384 other followers