Tips

This is just a dump of a few things we came across. Better here than not at all.

Main step by step guide to getting started.

http://blogs.msdn.com/jkowalski/archive/2008/10/24/using-ef-oracle-sample-provider-with-edm-designer.aspx?CommentPosted=true#commentmessag

no point redoing.


Install ODP.net 11.1.7.10 for .Net 2.0 (the ODAC package contain ODP.Net plus other client libs such as ODBC, Instant Client etc.)

http://www.oracle.com/technology/software/tech/windows/odpnet/index.html



step 10. (in the above post) the ssdl generated by edmgen in .net 3.5 sp1 requires replacing 'store:Schema="dbo"' with NOTHING and 'Schema="dbo"' with NOTHING btw. This is again oracle 11g. NOTE: store:Schema vs. Schema


step 8. (in the above post)

edmgen /provider:EFOracleProvider /mode:fullgeneration /connectionstring:"Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ORAdb.yourdomain.co.uk)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORAdb.yourdomain.co.uk)));User Id=your_user_name;Password=your_password;" /project:SomeProjectName

if you get any part of the connection string wrong you will get errors like

Error when invalid SERVICE_NAME is given:

error 7001: The provider did not return a ProviderManifestToken string.

ORA-12514: TNS:listener does not currently know of service requested in

connect descriptor

Error when invalid HOST is given:

error 7001: The provider did not return a ProviderManifestToken string.

ORA-12545: Connect failed because target host or object does not exist


if you are running the EFOracleProvider along side another modified version based on a copy of the project don't forget to create a new strong name key using sn.exe -k keyname.snk, in the project properties > signing > change to use this .snk file > recompile (the project is set to register in the GAC automagically).

then get the new public token by running sn.exe -T newEForacleProviderAssembly.dll and update the machine.config <DbProviderFactory> (step 5.)

Without this you may get an error saying that the @Provider name in the ssdl file is invalid or not registered properly because it is pointing at the other one that has a different name.



A connection string like this in the .config file works.
<connectionStrings>
<add name="xxxxxServiceContext" connectionString="metadata=res://*/DataModel.xxxxxservice.csdl|res://*/DataModel.xxxxxservice.ssdl|res://*/DataModel.xxxxxservice.msl;provider=EFOracleOdpProvider;provider connection string=&quot;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=youroradbhostname.abc.com)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=yourdbservicename.abc.com)));User Id=yourdbusername;Password=+your_password+;&quot;" providerName="System.Data.EntityClient" /></connectionStrings>

Replace underlined bits. Obviously password wouldn’t be in plain text here in production ;)


My machine config looks like this

<add name="EF Oracle Odp Data Provider" invariant="EFOracleOdpProvider" description="EF Odp Provider for Oracle testing" type="EFOracleOdpProvider.EFOracleOdpProviderFactory, EFOracleOdpProvider, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f6ad3e818a7c6d2a" />



Last edited Sep 18, 2009 at 3:43 PM by JA, version 3

Comments

blaumeiser Mar 10, 2010 at 4:30 PM 
I get this:

warning 6012: The function 'CHECK_DATAID' has a parameter 'P_INFO' that has a parameter direction value 'IN/OUT', which is not valid. Please use 'IN', 'OUT', or
'INOUT'.
error 6003: Unable to cast object of type 'System.DBNull' to type 'System.String'.

Generation Complete -- 1 errors, 137 warnings

what next?