Search Wiki:
Resource Page Description
Sample Entity Framework Provider for Oracle. Works with Oracle 10g by wrapping System.Data.OracleClient APIs. It is compatible with Entity Framework released as part of .NET Framework 3.5 SP1.


DISCLAIMER

This is an unsupported sample and should be treated as such. Although reasonable effort has been put to make sure that basic EF scenarios work with Oracle, there are certain limitations. Use in production environment is strongly discouraged.

INSTALLATION

  1. Install Visual Studio 2008 SP1 Beta.
  2. Install Oracle 10g Express Edition from http://www.oracle.com/technology/software/products/database/xe/index.html
  3. Add new user "edmuser" with password "123456" (if you change the user name/password you will need to update connection strings). The user needs to have permissions to create database objects (assigning the user to DBA role is the quickest way to give necessary permissions).
  4. The default connection string is using XE name from tnsnames.ora. If you have installed a different version of Oracle or used different instance configuration, you will have to update connection strings in App.config files.
  5. Review "OracleNorthwind/install_db.cmd" and adjust path to sqlplus.exe as necessary then run the batch file. It will create and populate a Northwind sample database in "edmuser" schema.
  6. Open the solution file EFOracleProvider.sln and run "EFOracleProvider.AdHocTests" and "Entity Framework Query Samples"

KNOWN ISSUES

  1. BINARY_FLOAT/BINARY_DOUBLE types are not supported. This is a limitation of underlying System.Data.OracleClient. Columns using those types have been replaced with NUMBER.
  2. Subqueries with aggregates are not supported. See RunNestedSubquery() method for an example. Users will see ORA-00904. This issue in Entity Framework has been fixed in post-beta builds and the fix will be included in final version of Visual Studio 2008 SP1.
  3. FunctionImportMapping does not call GetEdmType() when validating parameter mapping. As a result it is not possible to map Edm.Int32 to Oracle.EFOracle(Precision=11,Scale=0). This issue in Entity Framework has been fixed in post-beta builds and the fix will be included in final version of Visual Studio 2008 SP1.
  4. Oracle DDEX Provider for Visual Studio is not included. Example DDEX provider that supports SQL Server is available as part of EF Sample Provider at http://code.msdn.microsoft.com/EFSampleProvider
  5. APPLY operator is not supported by Oracle. As a result, certain queries that internally use this operator (such as "Average - Grouping 1", "Max - Grouping", "Min - Grouping") are not supported.
  6. Certain functions (AVG in particular) return numeric values that cannot be properly materialized as decimal by System.Data.OracleClient. As a result users will get OCI-22053 (overflow).
Last edited Jun 24 2008 at 1:12 AM  by jkowalski, version 7
Comments
Hollywood wrote  Jul 4 2008 at 1:16 PM  
I work on a project which works on two databases : SQL Server and Oracle.
Could I create two EDMX files, one for SQL Server (using Microsoft provider), the other for Oracle (using this provider) ?
The choice of the database could be a parameter on my web.config file...?

Thx

pisoias wrote  Aug 13 2008 at 2:35 PM  
Hello, I've migrated an edmx to use this Oracle provider (and also migrated the MSSQL database to Oracle 10g). Now I'm getting the following:

Schema specified is not valid. Errors:
EFOracleProvider.Resources.EFOracleStoreSchemaMapping.msl(3,4) : error 2002: The EntityContainer 'SchemaInformation' for the conceptual model specified as part of this MSL does not exist in MetadataWorkspace.

I don't know what that means, please help !
Thanks

shinji14 wrote  Jan 23 at 5:14 AM  
How this thing work with stored procedures?

FerHenrique wrote  Jan 29 at 11:16 AM  
jkowalski,
I would like to know if this example works with LINQ to Oracle...
thanks...

ddwoske wrote  Nov 3 at 8:42 PM  
Will it work with Oracle 11g and/or VS 2010.. anybody try it?

Updating...
Page view tracker