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)
7 Answers, 1 is accepted
(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)
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
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
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.
Ivailo
the Telerik team