Reporting Error: Invalid object name 'voa_keygen'

8 posts, 0 answers
  1. Richard M
    Richard M avatar
    76 posts
    Member since:
    Mar 2010

    Posted 04 Jan 2011 Link to this post

    I created a Telerik Report using the EntityDiagram ORM model to pull information from a Sql Server table.  I added a Telerik Report Viewer to my webpage, Default.aspx, and when I run it I get this error:

    Telerik.OpenAccess.RT.sql.SQLException: Invalid object name 'voa_keygen'.
       at Telerik.OpenAccess.RT.Adonet2Generic.Impl.StatementImp.executeQuery(String sql)
       at OpenAccessRuntime.Relational.sql.HighLowRelationalKeyGenerator.IsCached(Connection con, RelationalKeyGeneratorInfoCache infoCache, String tab, String kCol, String vCol, String key, Boolean& ret)
       at OpenAccessRuntime.Relational.sql.HighLowRelationalKeyGenerator.init(String className, RelationalTable theClassTable, Connection con, RelationalKeyGeneratorInfoCache relationalKeyGeneratorInfoCache)
       at OpenAccessRuntime.Relational.RelationalStorageManagerFactory.init(Boolean full)
  2. Richard M
    Richard M avatar
    76 posts
    Member since:
    Mar 2010

    Posted 04 Jan 2011 Link to this post

    I forgot to mention that I am pulling data from a Sql Server view, and not a table.
  3. DevCraft banner
  4. Richard M
    Richard M avatar
    76 posts
    Member since:
    Mar 2010

    Posted 04 Jan 2011 Link to this post

    I have tried changing the Identity Mechanism to "Backend Calculated" on my EntityDiagram class, and also making sure that a field in my class was set to "Identity".  But I am still getting the error in my EntityDiagrams.cs class:

    (error appears in this section of code)
            public IQueryable<V_my_reports> V_my_reports
            {
                get
                {
                    return this.GetAll<V_my_reports>();
                }
            }

    (error)
    Telerik.OpenAccess.RT.sql.SQLException: Invalid object name 'voa_keygen'.
       at Telerik.OpenAccess.RT.Adonet2Generic.Impl.StatementImp.executeQuery(String sql)
       at OpenAccessRuntime.Relational.sql.HighLowRelationalKeyGenerator.IsCached(Connection con, RelationalKeyGeneratorInfoCache infoCache, String tab, String kCol, String vCol, String key, Boolean& ret)
       at OpenAccessRuntime.Relational.sql.HighLowRelationalKeyGenerator.init(String className, RelationalTable theClassTable, Connection con, RelationalKeyGeneratorInfoCache relationalKeyGeneratorInfoCache)
       at OpenAccessRuntime.Relational.RelationalStorageManagerFactory.init(Boolean full)
  5. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 05 Jan 2011 Link to this post

    Hi Richard M,

    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.
    Please let us know if this does not help.

    Greetings,
    Alexander
    the Telerik team
    Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
  6. Michael
    Michael avatar
    19 posts
    Member since:
    Oct 2011

    Posted 07 Nov 2012 Link to this post

    I'm having the same issue and ALL my references to orm:key-generator in my rlinq file are set with name="autoinc" Is there a global default somewhere I need to change?
  7. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 09 Nov 2012 Link to this post

    Hello Michael,

    Even if you see in the rlinq file that all key-generator nodes are set to autoinc, it is possible that some classes in the model do not have the key-generator option set at all. As the default key generator is HighLow (the one which requires the voa_keygen table), you would get the same error if you have any classes in the model with no identity properties or with identity mechanism set to Default.
    For example, if you have classes mapped to views, they would not get automatically any primary keys and you would have to specify them manually. Please have a look at this article for more details how to achieve this.

    All the best,
    Alexander
    the Telerik team
    Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
  8. Michael
    Michael avatar
    19 posts
    Member since:
    Oct 2011

    Posted 09 Nov 2012 Link to this post

    Wouldn't it make sense to either set a different default or provide an easy way to find these offending entities then rather then sell me on a product intended to make my life easier and save me time then send me on this chase?
  9. Ivailo
    Admin
    Ivailo avatar
    318 posts

    Posted 14 Nov 2012 Link to this post

    Hi Michael,

    We have evaluated this problem and even the solutions you have suggested, as unfortunately it is indeed recurring frequently.

    If we set the default key generator is another one, you wouldn't be able to use the model unless you specify an Identity for your class. With the current generator, you still have errors but only for the classes for which you have specified the table explicitly - the tables that we generate would be fine. So basically we have chosen the better option that would ensure most scenarios would succeed.

    You are absolutely right that some kind of an indication should be there for all such cases. For that reason we have added a Validation Warning in the Validation Dialog, which should show you the problematic classes and offer you an automated action for resolving the problem. In case you have found any situation where this warning or error is not presented in the Error Pane, let us know and we will further improve this behavior.

    I hope I have shed some light on the matter. Do not hesitate to provide any other feedback you might have.

    All the best,
    Ivailo
    the Telerik team
    Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
Back to Top
DevCraft banner