Code First View Generation Generating Different Hash Values RRS feed

  • Question

  • Hi,

    We are currently developing a system that uses EF 5.0 (Code First) and WCF Data Services for its data access tier. We were experiencing slow initialization of the services and tracked this down to the view generation for our EF contexts, in some cases the views were taking 7 seconds to initialize. After some research we found the posts detailing the use of the EF power tools to pre-generate the views for the contexts in our project. We created a sample project and created the pre-generated views and found some significant speed improvements dropping the startup time by around 2/3rds. However when we have come to use the views in our live code we have found a problem with the view generation in that it creates different HashOverMappingClosure & HashOverAllExtentViews values on every development pc we run the generation on. This is obviously because the view it is generating is different but we cannot understand why this is the case when our development pc's are running off the same virtualized images with the only difference being the hardware they are running on. The above makes the generated views unusable because when the hash validation is run by EF it fails with....

    'The mapping and metadata information for EntityContainer '.....' no longer matches the information used to create the pre-generated views' 

    We have found the posts on the EF codeplex site detailing improvements in this area but this doesnt help us as we locked into version 5.0 of EF because of our dependancy on WCF Data Services. Is there any way we can get this working with version 5.0 by ensuring the hash's are generated in the same way on each pc? We are willing to take a look at the EF source, but we couldnt find version 5.0 on codeplex?

    Any help will be gratefully appreciated as we are keen to use the generated views as it makes a big difference to the response times in our application.

    Tuesday, May 7, 2013 11:39 PM

All replies