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

Upgrade to Domain Model

3 Answers 270 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.
jon
Top achievements
Rank 1
jon asked on 03 Sep 2010, 11:15 PM
We were using ReverseMapping and the ScopeProvider with a ScopeFactory, according to the best practice. 
Now we are upgrading to use the Domain Model, and we're having trouble with this error:
  "Telerik.OpenAccess.RT.sql.SQLException: Invalid object name 'voa_keygen'."

We read through the other forum posts on this issue, but its not helped.
http://www.telerik.com/community/forums/orm/databases/invalid-object-name-voa-keygen.aspx
http://blogs.telerik.com/blogs/posts/10-07-16/openaccess_orm_upgrade_model_tool.aspx
http://www.telerik.com/help/openaccess-orm/getting-started-root-migration-tool-use-migration-tool.html

I added the call to AdjustForDynamicLoad and also added the 'references' section to the config file manually, but that didn't help either.

 

 

 

 

<connectionStrings>
<add name="ColonyDB" connectionString="data source=dev-a;initial catalog=ColonyDB;persist security info=True;user id=DB;password=db" providerName="System.Data.SqlClient" />
<add name="EntityDiagrams" connectionString="data source=dev-a;initial catalog=ColonyDB;persist security info=True;user id=DB;password=db" providerName="System.Data.SqlClient" />
</connectionStrings>
<openaccess>
<references>

<

 

reference assemblyname="BusinessObjects" configrequired="True"/>

 

 

<
reference assemblyname="EntityDiagrams" configrequired="True"/>
</references>
</openaccess>
</configuration>

static public Database Database()
{
    if( theObjectScopeProvider1 == null )
        theObjectScopeProvider1 = new IColonyDB();
  if (theObjectScopeProvider1.myDatabase == null) {
    EntityDiagrams context = new EntityDiagrams();
    MetadataContainer metadata = context.Metadata;
    BackendConfiguration backendConfiguration = EntityDiagrams.GetBackendConfiguration();
    context.Dispose();
    theObjectScopeProvider1.myDatabase = Telerik.OpenAccess.Database.Get("ColonyDB", backendConfiguration, metadata);
  }
  return theObjectScopeProvider1.myDatabase;
}

Do you need any more info?

 

3 Answers, 1 is accepted

Sort by
0
Serge
Telerik team
answered on 08 Sep 2010, 08:31 PM
Hello jon,

You do not need to add anything in the config files. The OpenAccess section of the config file is now deprecated and should not be added. Let me shed some more information on the topic of upgrading. The new domain model should be used with the new context class that is generated by OpenAcccess. Usually the file that contains the context has the same name as the rlinq file.

What you are using - the object provider, is only there for backward compatibility and should not be used extensively. If the codebase is not too big I would suggest modifying the code to use the new context instead of the object scope. More info on how to implement the ContextFactory (previously ScopeFactory) you can find in this knowledge base article.

As to your problem with the voa_keygen, this usually means that at least one of the persistent classes uses the High-Low key generator as identity mechanism. I suggest you to check the identity mechanism for each class in the property pane of Visual Studio and update the value if needed. If you do not have any classes that use the High-Low key generator, the voa_keygen table would not be necessary and the error should disappear. You cal also have a look at this blog post, you should make sure there are no validation errors in the designer prior to running your solution.

Please contact us back if you are still experiencing problems or face further trouble.

Regards,
Serge
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
shivir
Top achievements
Rank 1
answered on 04 Feb 2011, 05:09 PM
"I suggest you to check the identity mechanism for each class in the property pane of Visual Studio and update the value if needed."

Referring to your above reply, can you please show me how to do it ?
0
Petko_I
Telerik team
answered on 09 Feb 2011, 06:31 PM
Hi shivir,

You can select a metaclass from the entity diagram and press F4. This focuses the property grid definition for the entity. The property grid is usually located below the the solution explorer. There you will find a property called Identity Mechanism. You should change the value depending on the type of identity for the selected entity. You can look at this help topic which elaborates on the different options for the key generators. Although the topic is covered in the classic wizards section, the principles are applicable to the domain model approach as well.

Do not hesitate to contact us, should  you have further questions.

Kind regards,
Petko_I
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
Tags
Data Access Free Edition
Asked by
jon
Top achievements
Rank 1
Answers by
Serge
Telerik team
shivir
Top achievements
Rank 1
Petko_I
Telerik team
Share this question
or