Multi database

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
alexis.lahsen
Posts: 5
Joined: Fri 24 May 2013 14:00

Multi database

Post by alexis.lahsen » Fri 24 May 2013 14:08

hello,

i have a .lqml file in my project for use with a oracle data base, but i do can change for sql server 2008 database. It's possible to use the same lqml file for the sql server? If yes how?

Thanks

(sorry if my english is not good )

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Multi database

Post by MariiaI » Mon 27 May 2013 12:26

To use the same DataContext and entity classes for different databases, you should provide different mapping information for the context instances. For example, you can do this via the XML mapping.

In this case you should do the following:
1. Change "Mapping Mode" in model settings to "File". Entity Developer will generate the mapping file ([YourModelName].xml) for the database you are using (Oracle in your case).
2. Make a copy of the generated xml file.
3. Change the connection in the Database Explorer to the necessary one.
4. Check the Target Server in Model Settings -> Synchronization -> Mapping. It must be set to the one that you are going to use (i.e., to SQL Server of the proper version).
5. Run the Update Database Wizard to create the database objects; select the 'Regenerate Storage' option at the first step of the wizard.
6. Save changes and open the mapping file. Now it should contain mapping for the new database.
7. Save this new mapping file somewhere and repeat the previous steps for other databases, if necessary.

For more information about using XML mapping, see http://www.devart.com/linqconnect/docs/?POCO.html

JIC: When working with different DBMSs it is necessary to clear the "Preserve schema name in storage" check box in the Model Settings.

Also, we recommend you to pay attention to the fluent mapping approach.

alexis.lahsen
Posts: 5
Joined: Fri 24 May 2013 14:00

Re: Multi database

Post by alexis.lahsen » Mon 27 May 2013 12:48

thanks you, but for the step 3 i can't change the connection for sql server i have only oracle database

MariiaI
Devart Team
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Multi database

Post by MariiaI » Tue 28 May 2013 08:48

You are using dotConnect for Oracle Professional, aren't you?
dotConnect for Oracle doesn't provide support for SQL Server, it supports only Oracle database. To implement your scenario and work with Oracle and SQL Server at the same time, you should either install additional LinqConnect Standard or use LinqConnect Professional instead of dotConnect for Oracle, depending on your overall goals.
For more information about the provided support in different editions of our products, please refer to:
http://www.devart.com/linqconnect/editions.html
http://www.devart.com/dotconnect/oracle/editions.html

Post Reply