Added new tables, got "voa_keygen" error

7 posts, 0 answers
  1. James
    James avatar
    11 posts
    Member since:
    Jan 2011

    Posted 07 Feb 2012 Link to this post


    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

  2. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 10 Feb 2012 Link to this post

    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 >>
  3. DevCraft banner
  4. James
    James avatar
    11 posts
    Member since:
    Jan 2011

    Posted 10 Feb 2012 Link to this post

    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!
  5. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 10 Feb 2012 Link to this post

    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 >>
  6. James
    James avatar
    11 posts
    Member since:
    Jan 2011

    Posted 10 Feb 2012 Link to this post

    Makes sense. Thanks a lot!

    Does "Default" just not do anything?
  7. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 10 Feb 2012 Link to this post

    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 >>
  8. James
    James avatar
    11 posts
    Member since:
    Jan 2011

    Posted 10 Feb 2012 Link to this post

    Good to know. Thanks for your help!
Back to Top
DevCraft banner