Oracle.DataAccess.Client

Topics: General Discussion Forum, July and December Releases Forum
Feb 7, 2007 at 5:56 PM
Edited Feb 7, 2007 at 5:56 PM
Working on a project where we are using SQL for development, but the database for production will be Oracle 10g. The database schema is designed in Visio and generated on both platforms.

The Business Entities, CRUD stored procedures and Respository are generated by the Data Access factory using the SQL connection.

We are planning to migrate the SQL stored procedures generaed by Data Access Guidance Package to PL/Sql, and to retain the sp name, parameters and datatypes.

But the problem for the moment is how to implement the connection to the Oracle Database.

We have tried to subclass GenericDatabase to create a Db that is compatible with Data Access Guidance Package. But that is not without hickups.

The issue is that OracleCommand in Oracle.DataAccess.Client is implementing IDbCommand but is not derived from DbCommand.

This typecasting is not allowed:

--
protected override void DeriveParameters(DbCommand discoveryCommand)
{
OracleCommandBuilder.DeriveParameters(discoveryCommand as DbCommand);

}
--

And we have to create something like this:

---
protected override void DeriveParameters(DbCommand discoveryCommand)
{
OracleCommandBuilder.DeriveParameters(
(OracleCommand)((IDbCommand)discoveryCommand)
);
}
---

This solution (not tested) will only implement the most basic operations, and a lot of Oracle methods that might improve performance is unavailable.

We could also wait for the comunity Oracle implementation (the current download doesn't work with Software Factory December 06), or we could create Business Logic that instansiate ODT classes and totally ignore the Repository.

Any suggestions?
Developer
Feb 8, 2007 at 6:31 PM
I'm not sure if this may be of some help but did you try the OracleSchemaDiscovery (http://www.codeplex.com/servicefactory/Wiki/View.aspx?title=OracleSchemaDiscovery&referringTitle=Home).
In case you already did, what about giving a try to the DAAB in EntLib 2.0? See (http://www.codeplex.com/entlib) and (http://msdn2.microsoft.com/en-us/library/aa480458.aspx)

Hernan
Feb 12, 2007 at 2:02 PM
I'll look into that.

The issue for the momemnt is that Oracle doesn't return a result set the same way as MS Sql. Unless anyone can prove me wrong, I'll have to use cursors to iterate over OracleDataReader from ODT.

Therefore, I cannot create common code for SQL and Oracle - the Repository is different, and I cannot replace the two databases by just changing the connection string.

Correct?

Jun 12, 2008 at 7:19 AM
Edited Jun 12, 2008 at 7:20 AM
Hi,

I will also planning to do a WCF application and I would like to use the software factory and guidance automation. But I have no idea it well goes with multiple databases. I have few questions on this.

1. If I have created the application with SQL Sever as back end. Can I easily prot to oracle or some other databases?
2.What are the steps to port to other databases?

Satheesh