none
Runtime Error 3032

    Question

  • Hi,

     

    I have been trying out the entity framework and have been pretty impressed so far - congratulations to all that have worked on it!!

     

    Having got a solution with 2 or 3 entities to work, I thought I'd go all-out and build quite a large entity model.  Unfortunately I decided to build it all before testing any of it!

     

    Now, my solution builds ok, but I get a series of runtime errors...

     

    EntityModel.msl(41,10) :

    error 3032: Problem in Mapping Fragment(s) starting at line(s) (41): Condition member 'tblFeatureReqHierarchy.Type' with a condition other than 'IsNull=False' is mapped. Either remove the condition on tblFeatureReqHierarchy.Type or remove it from the mapping.  EntityModel.msl(49,10) :

    error 3032: Problem in Mapping Fragment(s) starting at line(s) (49): Condition member 'tblFeatureReqHierarchy.Type' with a condition other than 'IsNull=False' is mapped. Either remove the condition on tblFeatureReqHierarchy.Type or remove it from the mapping.  EntityModel.msl(70,10) :

    error 3023: Problem in Mapping Fragment(s) starting at line(s) (70): In table tblParties, no mapping has been specified for column tblParties.Active - this column has no default value and is not nullable.  EntityModel.msl(131,10) :

    error 3023: Problem in Mapping Fragment(s) starting at line(s) (131): In table tblPartyHierarchy, no mapping has been specified for column tblPartyHierarchy.TreeLeft - this column has no default value and is not nullable.  EntityModel.msl(167,10) :

    error 3023: Problem in Mapping Fragment(s) starting at line(s) (167): In table tblRequestHistory, no mapping has been specified for column tblRequestHistory.UpdateDate - this column has no default value and is not nullable.  EntityModel.msl(204,10) :

    error 3023: Problem in Mapping Fragment(s) starting at line(s) (204): In table tblRequests, no mapping has been specified for column tblRequests.Name - this column has no default value and is not nullable.

     

    As far as I can tell (from the designer), everything is mapped fine.  Does anyone have any ideas?

     

    Thanks,

    - Chris

    Wednesday, June 18, 2008 4:07 PM

Answers

  • Ok, I'll deal with these one at a time:

     

    EntityModel.msl(41,10) :

    error 3032: Problem in Mapping Fragment(s) starting at line(s) (41): Condition member 'tblFeatureReqHierarchy.Type' with a condition other than 'IsNull=False' is mapped. Either remove the condition on tblFeatureReqHierarchy.Type or remove it from the mapping.

     

    - > You cannot use a property as both a mapping condition and an entitytype's property. You will need to remove that property from tblFeatureReqHierarchy. (Or not use it in a mapping condition.)

     

    EntityModel.msl(49,10) :

    error 3032: Problem in Mapping Fragment(s) starting at line(s) (49): Condition member 'tblFeatureReqHierarchy.Type' with a condition other than 'IsNull=False' is mapped. Either remove the condition on tblFeatureReqHierarchy.Type or remove it from the mapping.

     

    -> Same as above.

     

    EntityModel.msl(70,10) :

    error 3023: Problem in Mapping Fragment(s) starting at line(s) (70): In table tblParties, no mapping has been specified for column tblParties.Active - this column has no default value and is not nullable.

     

    -> You have an unmapped database column in your model, which is not allowed if that column has no default value or is declared as non-nullable. You will need to map it to a property on an entitytype in your model. Or remove that column from your SSDL/database.

     

    EntityModel.msl(131,10) :

    error 3023: Problem in Mapping Fragment(s) starting at line(s) (131): In table tblPartyHierarchy, no mapping has been specified for column tblPartyHierarchy.TreeLeft - this column has no default value and is not nullable. 

     

    -> Same as above.

     

    EntityModel.msl(167,10) :

    error 3023: Problem in Mapping Fragment(s) starting at line(s) (167): In table tblRequestHistory, no mapping has been specified for column tblRequestHistory.UpdateDate - this column has no default value and is not nullable. 

     

    -> Same as above.

     

    EntityModel.msl(204,10) :

    error 3023: Problem in Mapping Fragment(s) starting at line(s) (204): In table tblRequests, no mapping has been specified for column tblRequests.Name - this column has no default value and is not nullable.

     

    -> Same as above.

    Wednesday, June 18, 2008 9:16 PM

All replies

  • Ok, I'll deal with these one at a time:

     

    EntityModel.msl(41,10) :

    error 3032: Problem in Mapping Fragment(s) starting at line(s) (41): Condition member 'tblFeatureReqHierarchy.Type' with a condition other than 'IsNull=False' is mapped. Either remove the condition on tblFeatureReqHierarchy.Type or remove it from the mapping.

     

    - > You cannot use a property as both a mapping condition and an entitytype's property. You will need to remove that property from tblFeatureReqHierarchy. (Or not use it in a mapping condition.)

     

    EntityModel.msl(49,10) :

    error 3032: Problem in Mapping Fragment(s) starting at line(s) (49): Condition member 'tblFeatureReqHierarchy.Type' with a condition other than 'IsNull=False' is mapped. Either remove the condition on tblFeatureReqHierarchy.Type or remove it from the mapping.

     

    -> Same as above.

     

    EntityModel.msl(70,10) :

    error 3023: Problem in Mapping Fragment(s) starting at line(s) (70): In table tblParties, no mapping has been specified for column tblParties.Active - this column has no default value and is not nullable.

     

    -> You have an unmapped database column in your model, which is not allowed if that column has no default value or is declared as non-nullable. You will need to map it to a property on an entitytype in your model. Or remove that column from your SSDL/database.

     

    EntityModel.msl(131,10) :

    error 3023: Problem in Mapping Fragment(s) starting at line(s) (131): In table tblPartyHierarchy, no mapping has been specified for column tblPartyHierarchy.TreeLeft - this column has no default value and is not nullable. 

     

    -> Same as above.

     

    EntityModel.msl(167,10) :

    error 3023: Problem in Mapping Fragment(s) starting at line(s) (167): In table tblRequestHistory, no mapping has been specified for column tblRequestHistory.UpdateDate - this column has no default value and is not nullable. 

     

    -> Same as above.

     

    EntityModel.msl(204,10) :

    error 3023: Problem in Mapping Fragment(s) starting at line(s) (204): In table tblRequests, no mapping has been specified for column tblRequests.Name - this column has no default value and is not nullable.

     

    -> Same as above.

    Wednesday, June 18, 2008 9:16 PM
  • Thanks for the spedy response!

     

    You were exactly right on the first errors - I had the 'Type' discriminator as a property of the entity, too (because I didn't know you couldn't!).  I removed them as properties and now I get the following errors (I haven't looked at the 'no default value' problems yet - although I was certain I had set default values in SQL Server!!)...

     

    EntityModel.msl(33,10) : error 3034: Problem in Mapping Fragment(s) starting at line(s) (33, 41): Data loss is possible. Two disjoint partitions on the storage side are mapped to overlapping partitions in the conceptual side. Ensure disjointness on the conceptual side. You may be using an IsTypeOf() quantifier to map multiple types within one of these fragments. 

     

    EntityModel.msl(33,10) : error 3034: Problem in Mapping Fragment(s) starting at line(s) (33, 274): Data loss is possible. Two overlapping partitions in the storage model are mapped to equal partitions in the conceptual model. If you intended overlap in the storage model ensure they have similar relationship in the conceptual model. Data loss is possible. You may need to modify conditions in one of the Mapping Fragment elements.   

     

    EntityModel.msl(33,10) : error 3034: Problem in Mapping Fragment(s) starting at line(s) (33, 48): Data loss is possible. Two disjoint partitions on the storage side are mapped to overlapping partitions in the conceptual side. Ensure disjointness on the conceptual side. You may be using an IsTypeOf() quantifier to map multiple types within one of these fragments.

     

    If you could give me a pointer on these I'd really appreciate it - I'm not really sure I understand what the errors mean, let alone how to solve them!

     

    Thanks,

    - Chris

    Thursday, June 19, 2008 2:45 PM
  • Ok, first, regarding default values:

    Default values in SQL are not carried over into the SSDL - the reason is that those default values can be SQL expressions, which the client cannot execute.

     

    Regarding your errors - at this point you're getting into errors that are harder to guess at, but I'll give it a shot. One thing that could help is double-clicking these errors, they'll navigate to the objects specified by the lines (e.g. 33 and 41) and give you some clue as to where the problem is.

     

    EntityModel.msl(33,10) : error 3034: Problem in Mapping Fragment(s) starting at line(s) (33, 41): Data loss is possible. Two disjoint partitions on the storage side are mapped to overlapping partitions in the conceptual side. Ensure disjointness on the conceptual side. You may be using an IsTypeOf() quantifier to map multiple types within one of these fragments. 

     

    -> What this error is saying is that two types in your entity model ("conceptual side") which is must be separate, such as two different types in a hierarchy, are mapped to the same set of rows in the database model (storage side.) I could see this happening if you had the same discriminator value for a condition for two different types, e.g. Type="Bob" "Product" and Type="Bob" for "PremiumProduct".

     

    EntityModel.msl(33,10) : error 3034: Problem in Mapping Fragment(s) starting at line(s) (33, 274): Data loss is possible. Two overlapping partitions in the storage model are mapped to equal partitions in the conceptual model. If you intended overlap in the storage model ensure they have similar relationship in the conceptual model. Data loss is possible. You may need to modify conditions in one of the Mapping Fragment elements.   

     

    -> This one is new to me, you'll need to look at what the lines 33 and 274 point to in your MSL. If you post your model here - hopefully with any extraneous bits trimmed out, that would be helpful.

    Thursday, June 19, 2008 5:35 PM
  • Thanks for your help so far - this is really confusing me.  I'm working using the designer, so all my stuff is in an EDMX file so I can't work out what the line numbers in the error messages refer to!

     

    I've looked at the default value problems and everything looks ok to me!  I've posted my EDMX here.  Sorry I haven't trimmed it down but as I say - I can't work out where the problem is so I don't know what to trim!!

     

    If you have any ideas, I'd really appreciate it!

     

    Thanks,

    - Chris

     

    Saturday, June 21, 2008 12:22 PM
  • Ok, what you can do is right click the edmx file in VS and open it with the XML editor, rather than the designer. When you do this, double-clicking on the errors will take you to the right location in the EDMX file.

    Saturday, June 21, 2008 11:11 PM
  • Hello,

     

    Thanks for the pointer!

     

    Below is the code fragment for one of the "no default value or not nullable" problems (on tblProperty.Active).

     

    In this model, I have an abstract base class called "Party" with two entity types that inherit from it ("Individual" and "Company").  Originally I had the 'Active' property mapped to the "Party" entity, but this gave me errors on the other two entity types.  So - as you can see from this code, I tried putting an 'Active' property on each of the other two entities.

     

    This kind of helped in that now I get one error instead of two, but I can't add another 'Active' property to the base "Party" entity.

     

    Any thoughts?

     

    Thanks,

    - Chris

     

     

    Code Snippet

    <EntitySetMapping Name="Parties">
     <EntityTypeMapping TypeName="IsTypeOf(Insight2009Model.Individual)">
      <MappingFragment StoreEntitySet="tblParties">
       <ScalarProperty Name="Active" ColumnName="Active" />
       <ScalarProperty Name="SecretAnswerHash" ColumnName="UserSecretAnswerHash" />
       <ScalarProperty Name="SecretQuestion" ColumnName="UserSecretQuestion" />
       <ScalarProperty Name="PasswordHash" ColumnName="UsrPasswordHash" />
       <ScalarProperty Name="Type" ColumnName="Type" />
       <ScalarProperty Name="ID" ColumnName="ID" />
       <ScalarProperty Name="WorkEMail" ColumnName="IndWorkEMail" />
       <ScalarProperty Name="PersonalEMail" ColumnName="IndPersonalEMail" />
       <ScalarProperty Name="WorkMobile" ColumnName="IndWorkMobile" />
       <ScalarProperty Name="PersonalMobile" ColumnName="IndPersonalMobile" />
       <ScalarProperty Name="DirectDial" ColumnName="IndDirectDial" />
       <ScalarProperty Name="Title" ColumnName="IndTitle" />
       <ScalarProperty Name="LastName" ColumnName="IndLastName" />
       <ScalarProperty Name="FirstName" ColumnName="IndFirstName" />
       <Condition ColumnName="Type" Value="2" />
      </MappingFragment>
     </EntityTypeMapping>
     <EntityTypeMapping TypeName="IsTypeOf(Insight2009Model.Company)">
      <MappingFragment StoreEntitySet="tblParties">
       <ScalarProperty Name="Active" ColumnName="Active" />
       <ScalarProperty Name="ID" ColumnName="ID" />
       <ScalarProperty Name="Name" ColumnName="CoName" />
       <ScalarProperty Name="CoNumber" ColumnName="CoNumber" />
       <ScalarProperty Name="VATNumber" ColumnName="CoVATNumber" />
       <ScalarProperty Name="MainTelephone" ColumnName="CoMainTelephone" />
       <ScalarProperty Name="Fax" ColumnName="CoFax" />
       <ScalarProperty Name="Email" ColumnName="CoEmail" />
       <ScalarProperty Name="Type" ColumnName="Type" />
       <Condition ColumnName="Type" Value="1" />
      </MappingFragment>
     </EntityTypeMapping>
     <EntityTypeMapping TypeName="IsTypeOf(Insight2009Model.Party)">
      <MappingFragment StoreEntitySet="tblParties">
       <ScalarProperty Name="ID" ColumnName="ID" />
       <ScalarProperty Name="CountryID" ColumnName="CountryID" />
       <ScalarProperty Name="Postcode" ColumnName="Postcode" />
       <ScalarProperty Name="CountyID" ColumnName="CountyID" />
       <ScalarProperty Name="Town" ColumnName="Town" />
       <ScalarProperty Name="Address2" ColumnName="Address2" />
       <ScalarProperty Name="Address1" ColumnName="Address1" />
       <Condition ColumnName="Type" Value="0" />
      </MappingFragment>
     </EntityTypeMapping>
    </EntitySetMapping>

     

     

    Sunday, June 22, 2008 11:13 AM
  • Very helpful - Thank you much, Noam!
    Friday, August 12, 2011 6:43 PM