This is a migrated thread and some comments may be shown as answers.

upgrade adds a 2 on some foreign keys

1 Answer 72 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Håvard
Top achievements
Rank 1
Håvard asked on 19 Dec 2012, 09:13 AM
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?

1 Answer, 1 is accepted

Sort by
0
Accepted
Ralph Waldenmaier
Telerik team
answered on 19 Dec 2012, 12:38 PM
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.
Tags
Data Access Free Edition
Asked by
Håvard
Top achievements
Rank 1
Answers by
Ralph Waldenmaier
Telerik team
Share this question
or