How to support Oracle and SqlServer with only one model

4 posts, 0 answers
  1. Jan
    Jan avatar
    2 posts
    Member since:
    May 2009

    Posted 27 May 2009 Link to this post

    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?

  2. Peter Brunner
    Admin
    Peter Brunner avatar
    89 posts

    Posted 27 May 2009 Link to this post

    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.
  3. DevCraft banner
  4. Jan
    Jan avatar
    2 posts
    Member since:
    May 2009

    Posted 28 May 2009 Link to this post

    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.
  5. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 29 May 2009 Link to this post

    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.
Back to Top