Adapting the DAAB to use Oracle ODP.Net provider

April 15th, 2008

I’ve been doing a bit of tweaking of the Data Access Application Block to try and get around the problem described earlier.

I’ve replicated OracleDatabase, OracleDataReaderWrapper and the OracleDatabaseAssembler to reference the Odp provider (Oracle.DataAccess) rather than System.Data.OracleClient. I’ve called these classes OracleOdpDatabase etc. Inside them are some simple changes to enumeration values and data types (details on request).

Then a simple addition to the configuration details makes the block use the new objects rather than the old ones:
You need to add a providerMappings section inside the <dataConfiguration defaultDatabase="Dev" > section to indicate what new database class to use

<providermappings>
<add
databaseType= "Microsoft.Practices.EnterpriseLibrary.Data.Oracle.OracleOdpDatabase, Microsoft.Practices.EnterpriseLibrary.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null"
name="Oracle.DataAccess.Client" >
<providermappings>

Note that I haven’t ramped the version number here which I suspect I should if I end up using this in production.

Then in the connectionStrings section just reference the Odp provider:

<add
name="Dev"
connectionString="Data Source=dev;User ID=owner;Password=owner;"
providerName="Oracle.DataAccess.Client" />

The ODP provider doesn’t recognise the Unicode item in the connection string that I have been using with the Microsoft provider.

This mostly works but I am having problems getting return values from procedures with OUT parameters. More details to follow…

Posted in Development |

Comments

Leave a Reply

You must be logged in to post a comment.