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

How to support Oracle and SqlServer with only one model

3 Answers 153 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jan
Top achievements
Rank 1
Jan asked on 27 May 2009, 11:48 AM
My application should be able to work with either SqlServer or Oracle, just what is available at the customers network.
Of course I want to program my data access logic only once. 
How can I do that with OpenAccess? Are there any samples?

3 Answers, 1 is accepted

Sort by
0
Peter Brunner
Telerik team
answered on 27 May 2009, 08:59 PM
Hi Jan,

Database Independence is one of the major advantages of OpenAccess.

That means you develop your application, but stay independent from the deployment. The deployment can vary in terms of different databases, but additionally also in terms of different schemata.

Generally, the major differences are the data source and the mapping (defined in a mapping file outside of the code and outside of the database). If you can live with the same schema and data types, it will be even easier.

Please have a look to the following resources for more information

Please don't hesitate to contact us for any further question.

Regards,
Peter Brunner
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jan
Top achievements
Rank 1
answered on 28 May 2009, 09:24 AM
Thanks for the reply.
These examples are about a situation where you have two models releated to two bases.
In my situation I would have only ONE model, where the data can be either in a SqlServer or in an Oracle database. Both databases have the same table structure with only one difference: the primary key columns are generated by identities in SqlServer and triggers and sequences in Oracle. The table structure, indexes and foreign keys relations are equal.
I cannot find an example that shows how this can be solved.
0
Jan Blessenohl
Telerik team
answered on 29 May 2009, 02:55 PM
Hi Jan,
The easiest way is to reverse engineer both schemas so that the generated classes are the equal and put both mapping nodes from the app.configs in one file. Now you can refer them from different backendconfiguration and connection nodes as the example shows.

All the best,
Jan Blessenohl
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Databases and Data Types
Asked by
Jan
Top achievements
Rank 1
Answers by
Peter Brunner
Telerik team
Jan
Top achievements
Rank 1
Jan Blessenohl
Telerik team
Share this question
or