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

Migration Project : from OpenAccess 2009 version to last version + from VS 2008 to VS 2010 + from MySQL to MSSQL

6 Answers 114 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mika Jacobi
Top achievements
Rank 1
Mika Jacobi asked on 12 Jun 2010, 03:38 PM
Hello
thanks in advance to the telerik support team which proved to be generally reactive and efficient.

As stated in the topic subject, we are about to move our project to a stronger and more up-to-date software set.

1 - Firstly, we would like to update our telerik version (which is currently 2009.2.701) to the latest one.
2 - we are also moving from VS2008 to VS2010
3 - Last but not least, after validating our devs on a mysql DB, we would like to migrate to SQL Server, on a more robust environment.

So, before messing everything out and in order to do things in the cleanest way possible, we would like to have your advice to avoid precious knot-unmaking wasted time.

As of now, after backing up our projects, I replaced Telerik.OpenAccess.Query references by Telerik.OpenAccess.Extensions.35 after re-enabling the project to telerik OA in a brand new VS2010 instance. during the process I've pointed out to a new MSSQL version of our MySQL DB. After that though, tags referring to mysql like mysqlConfiguration and mysqlMapping are still coexisting with new mssqlConfiguration and mssqlMapping.

All the more, I have 3 errors upon building the main project :

OpenAccess Error: Telerik.OpenAccess: Updating SQL schema failed. No metadata has been registered for class StrativaLib.Strategy. (This usually indicates, that either this class is not declared persistent or it is declared persistent but not enhanced. The class was loaded from file:///X:/VS/Strativa/StrativaLib/bin/Debug/StrativaLib.dll.)   StrativaLib   

OpenAccess Error: No metadata has been registered for class StrativaLib.Strategy. (This usually indicates, that either this class is not declared persistent or it is declared persistent but not enhanced. The class was loaded from file:///X:/VS/Strativa/StrativaLib/bin/Debug/StrativaLib.dll.)   StrativaLib  

OpenAccess: X:\VS\Strativa\StrativaLib\obj\Debug\StrativaLib.dll: Error: Could not resolve: Telerik.OpenAccess.35.Extensions, Version=2010.1.527.2, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342  
     

Note that the 2 first errors go for all project classes (i.e error moves to another class as soon as the incriminated class is removed from project)
I sure have missed something there, and am ready to start the whole migration process all over from scratch.

The 3rd error keeps appearing from time to time although i've checked references and paths are ok...

PS :
I am not yet familiar at all with the so-called "enhancement",
I have no "really" persistent classes : simple DAL process to populate simple OOP objects from DB and the other way round.
(Although all classes are marked [Telerik.OpenAccess.Persistent(IdentityField="myClassId")]
I have also thought about forward engineering the SQL Server DB from the MySQL generated ORM objects

Running the post build command "c:\program files\telerik\openaccess orm\sdk\venhance.exe -assembly:$(TargetPath)"
did not help fix the problem

Thank you for your help and advice




Mika Jacobi
A&M Capital Research

6 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 14 Jun 2010, 12:56 PM
Hello Mika Jacobi,

I would suggest you to perform the three steps one by one and see if the project works correctly after each of them. This way we will be sure what is the cause of the problems because at this point I can see several possible problems that are not really related. First of all, please install the latest internal build (version 2010.1.610.1) that we published on Thursday last week. I believe it will solve the 35.Extensions reference problem. Then perform the steps in the following order:

 1. Run the check settings wizard to update all OpenAccess references. Details on how to use this wizard can be found here. As an alternative you can always update the references manually but I guess it would be easier to just run the wizard.
 2. Open the VS2008 solution in VS2010 and let the projects be converted. I do not expect any problems here.
 3. We keep separate mappings for each used backend because they usually differ from each other and a mysql mapping may not work with mssql. If you already have the database migrated to MsSql server I would suggest you to do the reverse mapping again. If you do not have it, you can use forward mapping as well. Just open the Forward mapping wizard and specify column/table names (you may not like the default ones). You will notice that the mssql mapping is populated with the newly configured options. If you decide to use forward mapping, please make sure the UpdateDatabase property of the project is set to True.

I hope that you will not face any problems with that procedure but if you do, please get back to us with details about the steps you did and the errors you get, we will help you to resolve them.

Regards,
Alexander
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
Mika Jacobi
Top achievements
Rank 1
answered on 15 Jun 2010, 02:18 PM
Brilliant.

2 first steps went perfect. 3rd is in progress. Will tell you how it all went or post again if i have any problem.

Telerik OA Wizards are just great.
I usually prefer to do things by hand in order to keep precise track of what have been done,
and what particular files and reference are where and why etc.
But I have to admit that this saved me a lot of pain and time.

I'll keep you posted.

MJ
0
Mika Jacobi
Top achievements
Rank 1
answered on 15 Jun 2010, 04:29 PM
Ok now,

After giving a try to the code (before even doing the reverse mapping from my MSSQL instance of the previous MySQL DB)
I got this error:
You must specify the element-type (or value-type for maps) for collections (and maps) for field 'link' or class 'myLib.myClass' needs to be enhanced, but wasn't.

this arises from a simple pre-test :

ObjectScopeProvider1.AdjustForDynamicLoad(); 
scope = ObjectScopeProvider1.ObjectScope();

//which calls the code below :
 
 
static public IObjectScope GetNewObjectScope() 
        { 
            Database db = Database(); 
            IObjectScope newScope = db.GetObjectScope(); //PROGRAM BLOWS HERE 
            return newScope; 
        } 

Cant' figure yet what went wrong.

Doing the reverse mapping from the new MSSQL instance(which  turned out to be "apparently" successful) didn't have any kind of effect on that.

Besides, i still have references to MySQL int he App.config like mysqlMapping
although I've changed the connection/backend configuration settings with the wizard (which changed some of the App.config parts such as the connection string). Don't know if there is a way to fully regenerate a new App.config from scratch...

Any help is welcome

MJ

0
Alexander
Telerik team
answered on 16 Jun 2010, 01:38 PM
Hello Mika,

I have an idea where could be the problem but I cannot be sure until I see the mappings. Could you please send me the reversemapping.config and App.config files of the project where the persistent classes are?

Kind regards,
Alexander
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
Mika Jacobi
Top achievements
Rank 1
answered on 16 Jun 2010, 03:30 PM
Hello Alexander

Pretty weird... the culprit was a "mysterious" field that popped out of nowhere in one of my main classes.
private IList<object> link = new List<object>()
Dropping it out of the code fixed the thing.
Seems like it had nothing to do with Tekerik OA.
My sincere apologies.

I am able to read smoothly from DB and populate objects now.
Will try to write and update DB (should go fine, I guess)

Reverse Mapping from our MSSQL shadow instance went well I might say.
Had some glitches with automatic classname generation that i've fixed by editing NamingRules.xml
Had also some quirks with few unhandled datatypes.

By the way, I don't know if there is a way to configure SQL types to .NET Types mapping, in order to override the default mapping, or to handle unhandled types like datetime2.

Besides, Although I ran the wizard, I had to manually change backendconfiguration id and mappingname from "mySQLxxx" to "MSSQLxxx". But I suppose this is no big deal since it has no technical impact I guess.

Anyway, thanks for your really precious support.
I'll be posting if I have some other issue.

Best Regards,
MJ


0
Alexander
Telerik team
answered on 16 Jun 2010, 05:15 PM
Hi Mika Jacobi,

I am glad to see that you have solved the problem. You can adjust the CLR - SQL type mappings from the OpenAccess -> Configuration -> Backend Configuration Settings dialog. At the bottom of the property grid you will find the necessary options.
If you are done with the migration to MSSQL server, you can delete the old mysql mappings / backend configurations from the App.config, they will not be needed anymore.

Kind regards,
Alexander
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.
Tags
General Discussions
Asked by
Mika Jacobi
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Mika Jacobi
Top achievements
Rank 1
Share this question
or