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

Adding Oracle to SQL Server based project

8 Answers 97 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Marcelo
Top achievements
Rank 1
Marcelo asked on 11 May 2011, 09:41 PM
I find some post here in forum, including http://www.telerik.com/community/forums/orm/databases/how-to-support-oracle-and-sqlserver-with-only-one-model.aspx, but I could not make it work.

I have a project using SQL Server, with all classes mapped with Attributes, and already with friendly names, ie, I changed all classes and property names because names in database follows client rules.

The Oracle database is already created with the same model and I need to support it.

I tried to create a app.config with two backends configurations but in the Wizard I can´t see this configurations to choose Oracle to update model from the database.

How can I proceed to maintain compatibility with two different databases with the exact same model ?

8 Answers, 1 is accepted

Sort by
0
Accepted
Alexander
Telerik team
answered on 13 May 2011, 03:59 PM
Hello Marcelo,

The forum thread you mentioned actually refers to the "classic" approach of using OpenAccess. The visual designer does not have yet the capability of handling multiple backends in a single rlinq file. However, this is one of our goals for the following Q2 release.
Until then, you can still switch the database server at runtime but this would only work in the cases when the two databases are 100% identical, in terms of table and column names as well as column types. If the databases differ in any way and this information is not available in the OpenAccess metadata (because currently we keep metadata for only one backend), this would lead to runtime errors. In order to switch the database you need to create a context instance and pass the appropriate connection string, as well as the backend configuration and metadata source. The code looks like this:

string connection = "MyConnectionString";
BackendConfiguration configuration = new BackendConfiguration();
configuration.Backend = "oracle";
MetadataSource source = AttributesMetadataSource.FromAssembly(typeof(Product).Assembly);
 
using (MyContext context = new MyContext(connection, configuration, source))
{
    ...
}
I hope that helps.

Kind regards,
Alexander
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
0
Mulham
Top achievements
Rank 2
answered on 31 Jul 2011, 09:01 AM
Hello,
Has this feature (having SQL server and Oracle side by side in the same model) been shipped in Q2? do you have any resources that can help me start up with this.

thanks,
Mulham
0
Alexander
Telerik team
answered on 03 Aug 2011, 04:08 PM
Hello Mulham,

Unfortunately the multi-backend functionality did not make it for the Q2 release. However, it is still with highest priority and we will try to provide it till the end of the year.
Please excuse us for the inconvenience caused.

Greetings,
Alexander
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
_TBS_
Top achievements
Rank 1
answered on 04 Jun 2013, 02:07 PM
Any update on this topic? I have OpenAccess Q1 2013... Thank you!
0
Marcelo
Top achievements
Rank 1
answered on 04 Jun 2013, 02:13 PM
I started using NHibernate
0
_TBS_
Top achievements
Rank 1
answered on 05 Jun 2013, 11:59 AM
And are you happy about it? Does it do what you requested initially?
0
Marcelo
Top achievements
Rank 1
answered on 05 Jun 2013, 01:17 PM
Yes, I've used before, but the customer sent using Telerik's ORM, but because of this and other problems returned to NHIbernate.

I do not know if the current version of this has already been solved
0
Ivailo
Telerik team
answered on 05 Jun 2013, 03:32 PM
Hi,

While a single model linked to two databases is still not supported, note that we have added a crucial feature to Telerik OpenAccess ORM that would allow you to change the database during runtime. It is called Backend Independent Mapping and is available through our Fluent Mapping API. It ensures that the types you have are defined in a way that allows multiple databases to be mapped to the same model without having to re-adjust the types.

In general, our recommendation for Visual Designer scenarios is to use two different RLINQ files for the two databases. Together with the Update from Database wizard, this approach would ensure that in case there are changes in one of the databases, which are not applied to the other, you won't risk any runtime exceptions such as missing tables or columns.

Let us know if you need any guidance on implementing this or any other scenario with OpenAccess ORM.

 

Regards,
Ivailo
Telerik
OpenAccess Samples Kit boasts 50+ sample applications providing diverse real-life business solutions. Click to read more and see OpenAccess ORM in action.
Tags
Getting Started
Asked by
Marcelo
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Mulham
Top achievements
Rank 2
_TBS_
Top achievements
Rank 1
Marcelo
Top achievements
Rank 1
Ivailo
Telerik team
Share this question
or