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

Added new tables, got "voa_keygen" error

6 Answers 155 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
James
Top achievements
Rank 1
James asked on 07 Feb 2012, 05:23 PM

Everytime I try to add a new SQL table into my ORM diagrams I use the "update from database" method. Everything works fine and the tables import with no problem. But when I try to run the solution it breaks in the 'EntityDiagrams.cs' file and throws the "Invalid object name 'voa_keygen'." error on an IQueryable of a table that I did not even import. I have many tables already in my solution that work just fine. It's just after I import new tables it's doing this. It's just weird because it's breaking on a table that I did not import.

If I get this answer:
"The 'voa_keygen' table is needed when there is at least one persistent class that uses the HighLow keygenerator.
To avoid the error please make sure none of the classes is using the Default or the HighLow identity mechanisms (the default is actually HighLow). I suspect that in the model you have another class with such settings that is causing the error. "

I would ask:
-How would I check to see if none of the classes are using the Default or the HighLow identity mechanisms? I haven't been able to find out where that is at.
-Why would it work previously on all my other tables? Then, after I "update from database" it breaks for a table that I did not even import and has been working already?

Thanks,
Coley

6 Answers, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 10 Feb 2012, 03:55 PM
Hi Coley,

 Is it possible that you have reverse mapped some view together with your tables? OpenAccess requires that each of your reverse mapped views has a primary key associated with them. If such is missing an internal identity is created that uses the voa_keygen table so that it can generate unique keys. 
You can check the identity mechanism for each of your domain classes by selecting them in the DSL designer and pressing F4. This will open the properties pane where you can see the Identity Mechanism property.

Regards,
Petar
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
James
Top achievements
Rank 1
answered on 10 Feb 2012, 05:18 PM
I did end up fixing it because one of the tables I was importing did not have a primary key set. After I set one it worked fine.

Thanks for letting me know where that property was for the Identity Mechanism! I had never noticed that. What is the difference between all of those? My options are Default, DatabaseServerCalculated, Guid, and HighLow.

Thanks for your help!
0
PetarP
Telerik team
answered on 10 Feb 2012, 05:23 PM
Hi Coley,

HIGHLOW – It is the default key generator and it uses a lookup table (the HIGHLOW or sequence block algorithm), i.e. it uses a last_used table to generate the id for a new instance. 
Guid - inserts a new guid into your Identity column (if the columns is indeed one that allows guids)
DatabaseServerCalculated - the identity is not handled by OpenAccess but by the database server you are using (for example - auto inc in SQL server).
 

Kind regards,
Petar
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
James
Top achievements
Rank 1
answered on 10 Feb 2012, 05:26 PM
Makes sense. Thanks a lot!

Does "Default" just not do anything?
0
PetarP
Telerik team
answered on 10 Feb 2012, 05:30 PM
Hi Coley,

 Default is the value that has been chosen as default for your project. It can either be Guid, HighLow or DatabaseServerCalculated. Currently Default results in HighLow and there is no way to change that as of now but in the future we will allow such per project settings.

Kind regards,

Petar
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
James
Top achievements
Rank 1
answered on 10 Feb 2012, 05:31 PM
Good to know. Thanks for your help!
Tags
Design Time (Visual Designer & Tools)
Asked by
James
Top achievements
Rank 1
Answers by
PetarP
Telerik team
James
Top achievements
Rank 1
Share this question
or