Print Page | Close Window

SQL-Server to Oracle

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=215
Printed Date: 19-Sep-2025 at 5:20pm


Topic: SQL-Server to Oracle
Posted By: Customer
Subject: SQL-Server to Oracle
Date Posted: 12-Jul-2007 at 3:54pm

I am not sure if this is the right place to ask these type of evaluation related questions but I am going to *ping* anyway. Please redirect me to appropriate channel if this not the right place.

Currently I am in process of evaluating IdeaBlade/DevForce as a potential application framework. I had been through most of training material and concepts manual but could not find a definitive answer to following question.

"In DevForce is it possible to hot-swap (or cold-swap with minimal reconfiguration) a datastore from, say, SQL-Server to Oracle provided they have same database schema? Is persistence manager smart enough to detect this change and generate SQL commands accordingly?"




Replies:
Posted By: IdeaBlade
Date Posted: 12-Jul-2007 at 3:55pm
It's possible to write a single application that will run on either SQL Server or Oracle depending on the connection string,  There are acually a number of ways to do this, but I would do this through a Datasource Extension.  One extension would be for SQL Server.  A second extension would be for Oracle.  We actually have a very large number of our unit tests that run the same application on different kinds of databases. Refer to the Developer's Guide for more details.


Posted By: Customer
Date Posted: 12-Jul-2007 at 3:56pm
Thanks for quick reply. If I correctly understood you then suppose
 
I have a SQL Server database, say myDB, that I used with IdeaBlade object mapper to generate my business model classes. The application was developed and runs fine.
Now I want this application to run against oracle version of myDB. Do I just have to add/update extensions in IdeaBlade.ibconfig and the object model that was actually developed using SQL Server version will still work fine. OR do I have to open the source code and regenerate the model for oracle.
 
I am very novice in IdeaBlade so need some extra help to figure out these basic requirements.


Posted By: IdeaBlade
Date Posted: 12-Jul-2007 at 3:56pm
Yes.  You are essentially correct.  You do not have to open source code and regenerate the model for Oracle.  However, there is one additional piece of code that you would need to add.  That is a DataSourceMappingInterceptor.  The DataSourceMappingInterceptor is used to handle the inevitable differences between an Oracle Database and a SQL Server Database.  For example, the table owner names might be different, or you may want convert some table names to upper case.  This is some of the code that you might need for an Oracle DataSourceMappingInterceptor.
 
foreach (DataColumnMapping columnMapping in info.TableMapping.ColumnMappings) {
columnMapping.SourceColumn = columnMapping.SourceColumn.ToUpper();
}
info.ConcurrencyColumnName = info.ConcurrencyColumnName.ToUpper();
if (info.ColumnInsertMap.ContainsKey("RowVersion")) {
info.ColumnInsertMap["RowVersion"] = info.ColumnInsertMap["RowVersion"].ToUpper();
}
if (info.ColumnUpdateMap.ContainsKey("RowVersion")) {
info.ColumnUpdateMap["RowVersion"] = info.ColumnUpdateMap["RowVersion"].ToUpper();
}
 
Once you've written one DataSourceMappingInterceptor for one application, there is a good chance that you can reuse it for other applications.
 
Please read the attached document on Data Transforms.
 

 




Print Page | Close Window