Print Page | Close Window

DevForce EF - Oracle

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=935
Printed Date: 14-May-2025 at 9:12pm


Topic: DevForce EF - Oracle
Posted By: pokaragat
Subject: DevForce EF - Oracle
Date Posted: 15-Sep-2008 at 9:19am
I have downloaded the trial version of the released DevForce EF. Our database is Oracle. I do not see any documentation on how to do it with devForce EF. Any help?
 
Thanks.



Replies:
Posted By: jeffdoolittle
Date Posted: 15-Sep-2008 at 9:52am
I've got a client who has asked about oracle support as well, so I'd also be interested to hear the answer to this question.


Posted By: kimj
Date Posted: 15-Sep-2008 at 10:21am
DevForce EF supports any of the database providers which support the Entity Framework.  Oracle providers include OraDirect.NET from DevArt ( http://devart.com/oranet/ - http://devart.com/oranet/ ) and DataDirect ( http://www.datadirect.com/products/net/netrelhighlights/index.ssp - http://www.datadirect.com/products/net/netrelhighlights/index.ssp ). 
 
Keep an eye on the ADO.NET team blog for more information on providers supporting EF:  http://blogs.msdn.com/adonet/default.aspx - http://blogs.msdn.com/adonet/default.aspx .


Posted By: pokaragat
Date Posted: 15-Sep-2008 at 10:34am
Have you performed tests against these two products? How stable is the integration between these dataproviders and DevForce EF?
 


Posted By: kimj
Date Posted: 15-Sep-2008 at 12:40pm
DevForce EF delegates all database access to the Entity Framework; there is no integration point between DEF and a datasource or datasource provider.   This means that any provider supporting EF should "just work" in DevForce EF.  


Posted By: pokaragat
Date Posted: 16-Sep-2008 at 7:14am

So, I gave it a try. I used OraDirect.Net as the dataprovider.

Everything seem to work, until DevForce can't save a the modified data. And so, why?
 
We have an existing oracle database with timestamp as a column as part of the primary key with seven digit precision, say 9/16/2008 7:58:39.1234567. I found out that when the data was fetched, it only returned 9/16/2008 7:58:39.1230000, a loss of 4 digit precision. DevForce should have thrown an 'Concurrency Exception' since the it cannot find the row with the keys, but did not. Whose issue is this, DevForce or OraDirect.Net? I modified the data in the database manually to have a 3 digit precision, and it worked fine.
 
This is just one issue I found in an hour of real life programming. More issues to be found. And so, it requires integration tests. Are the customers of DevForce EF willing to take the pain to do the integration tests?
 
I also placed a topic in the devart forum for OraDirect.net http://devart.com/forums/viewtopic.php?p=38706#38706 - http://devart.com/forums/viewtopic.php?p=38706#38706 .


Posted By: pokaragat
Date Posted: 16-Sep-2008 at 8:22am
Correction from the previous post:
 
DevForce EF threw an Exception EntityManagerSaveException, with a type IdeaBlade.EntityModel.v4.PersistenceFailure.Concurrency.


Posted By: skingaby
Date Posted: 18-May-2009 at 12:51pm
So it is a few months/versions later. DevForce EF is now rebranded and in RC2 for Silverlight, and that is the version I am working with. devart's dotConnect for Oracle drivers are at v.5.20.29.

devart has a nifty little Entity Diagram editor as an included tool in their dotConnect driver product. This editor takes care of a lot of the hassle of mapping Oracle TABLE_NAMES to normal looking EntityNames.

It does produce the same Entity Framework XML data as the ADO Entity Designer, however, these reside in a file named: *.edml instead of the ADO ED file *.edmx. The contents of these files adhere to the same XML schema, but the corresponding .vb file and several other hidden .designer files are quite different.

Now, I get to my question:

Can the DevForce Mapper be changed to allow opening these *.edml files as a "New Model" instead of just the current *.edmx file?

Presently, to work with these tools I either have to: a) forego using the slickness that is the devart Entity Developer and do all of the mappings it is doing by hand in an ADO ED diagram; or b) copy-and-paste the XML from their diagram into the XML of a ADO ED diagram and then run your tool; or c) rename their .edml file to .edmx whenever I want to run your tool.

I look forward to your reply. Thanks, Simon.



Posted By: skingaby
Date Posted: 18-May-2009 at 12:57pm
Also, I was able to open the .edml file as a New Model by renaming it to be an .edmx file. However, I cannot open an .edmx file in the devart ED so I will have to rename it back to edit the server model and rename it back to edit the devforce business model. Ack!

Further however, and this was fatal, the devforce mapper wrote back the .edml file (while it was renamed) and removed the edmx: namespace tag from the Designer section. (The same way the ADO ED does.) I will follow up with devart about this though because it seems that their xml file is not in compliance with the ADO ED file.

I edited the XML in the .edml/.edmx file and put the edmx: prefix back into the designer content section of the file. This enabled me to open the file in their Entity Developer again.

Lastly, I edited the XML in the ibedmx file you generate and changed the <EdmxRef FileName=".\DataSourceModel1.edmx" /> to "...edml" and now the two are linked up nicely.


Posted By: skingaby
Date Posted: 18-May-2009 at 1:59pm
Summary:

To use the Devart dotConnect driver, and its accompanying tool: Devart's Entity Developer, with IdeaBlade DevForce EF:
1) Create a new Devart Entity Model.
2) Add a table to the model and save it.
3) Rename the model.edml file to model.edmx.
4) Open the Devforce Object Mapper.
5) Add the model.edmx as a New Model in the Devforce Object Mapper.
6) Save the model and close the mapper.
7) Edit the model.edmx as XML. Locate the <Designer> tag at the bottom of the XML file. Put a "edmx:" prefix in front of the Designer, Connection, and Options tags.
8) Save and close the model.edmx file.
9) Rename it back to model.edml. (It should now open in the Devart Entity Developer properly.)
10) Edit the .ibedmx file as XML. Locate the <EdmxRef> tag and change the file extension from model.edmx to model.edml.

Now, the Devart Entity Developer and the Devforce Object Mapper are both working off the same .edml file.
However, should you change ANYTHING in the Devforce Object Mapper, it will re-write the .edml file and you will have to redo Step 7) above to put the edmx: prefix back in there. I have posted this to http://www.devart.com/forums/viewtopic.php?t=14875 - Devart Support as it seems like they own the code that writes the incorrect tags.


Posted By: eileenv
Date Posted: 18-May-2009 at 4:33pm

You don't have to do the rename to bring the file into the DevForce Object Mapper. The open dialog by default filters on either *.ibedmx or *.edmx, but there is also an "All Files (*.*)" option as well. Therefore you can open (and then modify and save) a file with a different extension.



Posted By: skingaby
Date Posted: 19-May-2009 at 8:35am
Ah-hah. You are using the File | Open menu option in DevForce Object Mapper instead of the Model | Add Entity Model menu option. Sweet.


Posted By: skingaby
Date Posted: 04-Jun-2009 at 2:41pm
I have been working with the Oracle-Devart-EntityFramework-Devforce stack for a couple of weeks now. I wanted to post something somewhere about one of the challenges with using this stack. The DevArt Entity Designer does not play nicely with the Entity Framework EDMX file. I am currently working with this stack by:
1) Including an Entity Framework EDMX model in my ServerModelEF project.
2) Excluding, but having, a DevArt Entity Designer EDML model in that same ServerModelEF project.
3) Having a DevForce model in the ServerModel (not ServerModelEF) project.
4) The DevForce model is connected to the EDMX model.
5) When I need to edit the EF model, I copy the XML from the EDMX file to the EDML file, then I edit it in DevArt ED, then, when that is saved, I copy the XML back to the EDMX file EXCEPT I do not copy back the <Designer>...</Designer> tag contents at the bottom as the EDML is missing the <Diagrams> tag that the Entity Framework EDMX needs.
(Yes, this is tedious, but it seems to keep things straight.)
6) When the EDMX file is saved, DevForce notices and regenerates its generated code.



Print Page | Close Window