Internal Identity Errors

9 posts, 1 answers
  1. Brian
    Brian avatar
    40 posts
    Member since:
    Oct 2008

    Posted 20 Sep 2010 Link to this post

    With the 2010 Q2 ORM release (2010.2.804.5), I got my domain model to build with no errors and have checked everything as best I can.  Specifically, I have a single-field identity 'ID' set for every table as an Int32, which is set Identity and 'Backend Calculated' in the edit table dialog, Identity True in the model, nullable false, kind Default, and the table itself has Identity Mechanism 'BackendCalculated'.  Here is some example code from the .rlinq file:

    in the MetaClass Attributes element:
    <MetaProperty Id="2a03bd86-978a-439a-9deb-27c144e419e9" Name="ID" accessModifier="Public" inheritanceModifier="None" Type="Int32" label="ID : Int32" kind="Default" nullable="false" hasGetter="false" hasSetter="false" identity="true" isNavigable="false" loadBehavior="Default" />
     
    in the orm:class element:
    <orm:identity>
       <orm:key-generator name="autoinc" />
       <orm:single-field field-name="ID1" />
    </orm:identity>

    I don't see anywhere how this is perceived as a internal identity field, which is the error message (Telerik.OpenAccess.Runtime Class 'ClassNameHERE' uses internal identity but has a pk field 'ID1'.) I get at runtime when I try to setup the schema or do any context create/query.  I've been struggling with this for a while...  can you help?  Thanks!
  2. Serge
    Admin
    Serge avatar
    375 posts

    Posted 21 Sep 2010 Link to this post

    Hi Brian Womack, PhD,

     This is something that another one of our customers reported and we did not have the luck to reproduce it on our side. If it is not too much trouble can you send us your project so that we can debug it locally or assemble a sample project that shows this kind of behavior. Your collaboration on this one will be highly appreciated as we are also very keen on fixing this bug for good.

    We are looking forward to resolving this issue, however we will need your help to do so.

    Kind regards,
    Serge
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Brian
    Brian avatar
    40 posts
    Member since:
    Oct 2008

    Posted 21 Sep 2010 Link to this post

    Hey guys, I think I found the answer (after about 4 days of effort).. Any chance that I'll get some Telerik Points if I'm right? *SMILE*

    I found the problem by comparing my production project with the code community project I just submitted (MyORM).  It has to do with the code generation method.  If you select a Mapping type of 'Attributes' instead of the default 'Xml', you get this problem.  Making the one line change in either the .rlinq file or using the model context menu choice 'Show Model settings...', tab 'Code Generation Settings', dropdown 'Mapping type:', to 'Xml'.

    Before:
    <CodeGenerationSettings>
      <ShouldGenerateContext>true</ShouldGenerateContext>
      <OutputProjectName>MyORM</OutputProjectName>
      <OutputProjectFolder>\Generated\</OutputProjectFolder>
      <OutputPath>Generated\</OutputPath>
      <UseCustomTemplate>false</UseCustomTemplate>
      <MappingDefinitionType>Attributes</MappingDefinitionType>
      <GenerateMultipleFiles>true</GenerateMultipleFiles>
      <OverrideToAutoProperties>true</OverrideToAutoProperties>
      <OutputMode>ProjectFolder</OutputMode>
    </CodeGenerationSettings>

    After:
    <CodeGenerationSettings>
      <ShouldGenerateContext>true</ShouldGenerateContext>
      <OutputProjectName>MyORM</OutputProjectName>
      <OutputProjectFolder>\Generated\</OutputProjectFolder>
      <OutputPath>Generated\</OutputPath>
      <UseCustomTemplate>false</UseCustomTemplate>
      <MappingDefinitionType>Xml</MappingDefinitionType>
      <GenerateMultipleFiles>true</GenerateMultipleFiles>
      <OverrideToAutoProperties>true</OverrideToAutoProperties>
      <OutputMode>ProjectFolder</OutputMode>
    </CodeGenerationSettings>
  5. Serge
    Admin
    Serge avatar
    375 posts

    Posted 23 Sep 2010 Link to this post

    Hello Brian Womack,

     I am glad that you have found a solution to your problem. Unfortunately this means that there is a bug present in our Attributes Mapping that is left unresolved. Please do find you Telerik point updated. 

    One last thing - if you were to send us a solution that we could use to reproduce this problem it would be greatly appreciated by us and by the community.

    Again I am glad you solved your problem. 

    Kind regards,
    Serge
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Brian
    Brian avatar
    40 posts
    Member since:
    Oct 2008

    Posted 23 Sep 2010 Link to this post

    I already did (that project was used by me to investigate several problems and do a lot of learning), it is in my ORM N-Tier Domain Model Forward Development project in the code community.  All you need to do in order to trigger the error is to change the code generation from Xml to Attribute.  It happens with that project as well.
  7. Answer
    Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 28 Sep 2010 Link to this post

    Hi Brian Womack,

     This appeared to be caused by a bug in our attributes mapping which is exposed by using horizontal inheritance strategy as you have in your project. This was really helpful from your side in order for us to locate and fix this bug, so you can find your Telerik points updated. The fix will be part of the next internal build which we plan to release in the following week or for the upcoming Q3 release the latest. 

    Kind regards,
    Zoran
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Brian
    Brian avatar
    40 posts
    Member since:
    Oct 2008

    Posted 28 Sep 2010 Link to this post

    You are welcome. :)  And thank you!  I want you guys to succeed, because you have a great product that is maturing nicely.  I think this last version had a ton of new stuff, and I'm happy to help make it better.
  9. Christian
    Christian avatar
    81 posts
    Member since:
    Aug 2008

    Posted 03 Mar 2011 Link to this post

    Hi,
    I get the same error message. My class has an pk-field with the name 'ID' of type GUID. I use the ORM version 1125.1.

    The rlinq-file contains the following part:

    <MetaClass Id="b107507d-e8a6-4fbd-a8f2-6a2dbfcb9bbe" Name="clsAMOKObjekt" namespace="Berlin.Polizei.INGO.Klassenbibliothek" accessModifier="Public" Kind="Default" doubleDerived="false" cachePolicy="Default" identityMechanism="BackendCalculated" concurrencyMode="Default" concurrencyMember="(AUTO)" updateSchema="true">
              <Attributes>
                <MetaProperty Id="0e148e69-1de8-4327-ba93-7d7f41238c0a" Name="Voaversion" accessModifier="Public" inheritanceModifier="None" Type="Int16" label="Voaversion : Int16" kind="Default" nullable="false" hasGetter="true" hasSetter="true" identity="false" isNavigable="false" loadBehavior="Default" />
                <MetaProperty Id="c7cda339-8127-4ad1-b1a5-a7596a2b92b7" Name="Id" accessModifier="Public" inheritanceModifier="None" Type="Guid" label="Id : Guid" kind="Default" nullable="false" hasGetter="true" hasSetter="true" identity="true" isNavigable="false" loadBehavior="Default" />
                <MetaProperty Id="7c131fcc-9447-4167-8e0b-ea3d8414e1f4" Name="ZugeordGrundObjekt" accessModifier="Public" inheritanceModifier="None" Type="Guid" label="ZugeordGrundObjekt : Guid" kind="Default" nullable="true" hasGetter="true" hasSetter="true" identity="false" isNavigable="false" loadBehavior="Default" />
                <MetaProperty Id="54a3b00b-1f18-441f-9391-b600b33addbe" Name="GrundObjektList" accessModifier="Public" inheritanceModifier="None" Type="IList<clsGrundObjektInformation>" label="GrundObjektList : IList<clsGrundObjektInformation>" kind="Default" nullable="true" hasGetter="true" hasSetter="true" identity="false" isNavigable="true" loadBehavior="Default" />
              </Attributes>
              <implementedProperties>
                <classHasImplementedProperties Id="bd39c09a-b9fa-4a83-bef0-d44fc919ab4f">
                  <implementedMetaProperty Id="58248ed1-699d-4298-b55b-6a92c8c028ea" Name="Autor" accessModifier="Public" inheritanceModifier="None" label="Autor : String" kind="Default" nullable="false" hasGetter="false" hasSetter="false" identity="false" isNavigable="false" loadBehavior="Default" />
                </classHasImplementedProperties>
                <classHasImplementedProperties Id="eafa72fe-1649-4c7e-8f30-650241abbc0f">
                  <implementedMetaProperty Id="4e430e7a-7cb6-404e-9ba8-103e55fd1499" Name="LastUpdate" accessModifier="Public" inheritanceModifier="None" Type="DateTime" label="LastUpdate : DateTime" kind="Default" nullable="false" hasGetter="false" hasSetter="false" identity="false" isNavigable="false" loadBehavior="Default" />
                </classHasImplementedProperties>
                <classHasImplementedProperties Id="cbd32374-c978-4109-9745-e5059b104e6e">
                  <implementedMetaProperty Id="9a49e06d-d9db-4ec8-83fa-37cf9a4ebeac" Name="CreateDate" accessModifier="Public" inheritanceModifier="None" Type="DateTime" label="CreateDate : DateTime" kind="Default" nullable="false" hasGetter="false" hasSetter="false" identity="false" isNavigable="false" loadBehavior="Default" />
                </classHasImplementedProperties>
              </implementedProperties>
            </MetaClass>

    What must I do to to avoid the error message?

    Kind regards
    Christian
  10. Zoran
    Admin
    Zoran avatar
    534 posts

    Posted 09 Mar 2011 Link to this post

    Hello Christian,

     
    I believe that the workaround for you would be to switch to using Xml mapping in your .rlinq model. At the moment we are having some problems with reading the metadata from the Clr attributes and using Xml should not change anything in your experience with the product.

    Kind regards,
    Zoran
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top
DevCraft banner