New Posts New Posts RSS Feed: SQL-Server to Oracle
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

SQL-Server to Oracle

 Post Reply Post Reply
Author
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Topic: SQL-Server to Oracle
    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?"

Back to Top
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post 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.
 

 



Edited by IdeaBlade - 12-Jul-2007 at 3:57pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down