upgrade adds a 2 on some foreign keys

2 posts, 1 answers
  1. Håvard
    Håvard avatar
    11 posts
    Member since:
    Dec 2009

    Posted 19 Dec 2012 Link to this post

    I've tried to upgrade openaccess from 2010.1.312.2 to 2012.3.1209.1 in one of our projects. (Oracle database. The reason for upgrading is a bug in 2010 when upgrading a project to .net 4 and it wants a vistadb dll v4 which now I can only find v4.1)

    I've tried to only upgrade the references and replaced all old binaries with new ones. 

    It does compile but when running some of our queries this exception appears:

    Telerik.OpenAccess.Exceptions.DataStoreException was unhandled by user code
    Message=Error executing query: Telerik.OpenAccess.RT.sql.SQLException: ORA-00904: "A"."AQMN_GUID2": invalid identifier


    the generated query is quite long so heres the relevant part, this is the working query on 2010 openaccess:

    SELECT a."AQTS_GUID"                 COL1,
           a."ALLOWEXCEEDANCEEXTRACTION" COL2,
           a."AQCO_GUID"                 COL3,
           a."AQCO_GUID"                 COL4,
           a."AQMN_GUID"                 COL5,
           a."AQMN_GUID"                 COL6,
           a."AQMS_GUID"                 COL7,
           a."AQMS_GUID"                 COL8,
           a."AQMM_GUID"                 COL9,
           a."AQMM_GUID"                 COL10,
           a."AQST_GUID"                 COL11,
           a."AQST_GUID"                 COL12,
           a."AQTO_GUID"                 COL13,
           a."AQTO_GUID"                 COL14,
           a."AQUN_GUID"                 COL15,
           a."AQUN_GUID"                 COL16,
    ...

    and this is the new:

    SELECT a."AQTS_GUID"                 COL1,
           a."ALLOWEXCEEDANCEEXTRACTION" COL2,
           a."AQCO_GUID"                 COL3,
           a."AQCO_GUID"                 COL4,
           a."AQMN_GUID2"                COL5,
           a."AQMN_GUID"                 COL6,
           a."AQMS_GUID"                 COL7,
           a."AQMS_GUID"                 COL8,
           a."AQMM_GUID2"                COL9,
           a."AQMM_GUID"                 COL10,
           a."AQST_GUID"                 COL11,
           a."AQST_GUID"                 COL12,
           a."AQTO_GUID"                 COL13,
           a."AQTO_GUID"                 COL14,
           a."AQUN_GUID2"                COL15,
           a."AQUN_GUID"                 COL16,
    ...

    It has added a 2 to some of the foreign keys which of course will fail, but why is this happening and how do I fix it?
  2. Answer
    Ralph Waldenmaier
    Admin
    Ralph Waldenmaier avatar
    202 posts

    Posted 19 Dec 2012 Link to this post

    Hi Håvard,
    Based on the information you provided I am guessing that you are using our visual designer and have specified to generate a fluent mapping. Also I guess you have a reference to another class and have also a shared id field that is shared with this reference. If this is the case, then there is a problem that the metadata used in our runtime system is calculated wrongly, which results in these wrong sql statements. We are already aware of this issue and will address it as soon as possible.
    In the meantime, you can work around this issue by switching from fluent code generation to xml code generation.
    Please accept my apologies for the inconvenience this might cause.

    I hope this information is helpful for you. 
    Do come back if you need further assistance.
     
    All the best,
    Ralph
    the Telerik team
    Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
  3. DevCraft banner
Back to Top