2

I am working on an application (let's call it A, an ASP.NET MVC3 web site) in .NET 4.0, under Visual Studio 2010 and with Entity Framework and Oracle. Everything goes right.

For an other application (let's call it B), I installed Visual Studio 2012, which installed the new version of the .NET framework. Since, I can not get A working right.

The error I get is : Oracle 11.2.0.3.0 does not support APPLY

I've made some digging and I found a solution : uninstall the .NET framework 4.5 when I need to work on A, and install it back when I need to work on B. This is not very
satisfactory.

It looks like Oracle did not succeed to translate the EF query into an Oracle query. But why ? I still target the same version of the .NET framework (4.0) ...

I am currently trying different ODAC version in order to see if the problem could come from an incompatibility between ODAC and the new version of .NET.

Do you have any other idea of what could cause that and how to fix it ?

Thank you !

Sorry for my english, I am not a native speaker.

fharreau
  • 2,105
  • 1
  • 23
  • 46

1 Answers1

2

Oracle does not support CROSS/OUTER APPLY and some queries generated by EF require these operators. See this and this for more details

Having said that - as per the comments there seems to be a regression in EF5/.NET Framework 4.5 where EF started creating Apply nodes in queries for which Apply nodes were not created in EF4. It was previously investigated but apparently this scenario was not covered.

This regression was actually fixed in EF6 (which is probably not extremely helpful since currently there is no Oracle EF6 provider (at least not from Oracle) at this point)

Pawel
  • 31,342
  • 4
  • 73
  • 104
  • The thing is, the same code worked well without the framework .NET 4.5 installed. I didn't update my nuget package, so I still have the same version of EF. I still target the same version of .NET (4.0), etc. Why suddenly this error happens ? – fharreau Dec 19 '13 at 09:00
  • Then this looks like a regression in .NET Framework 4.5. Can you open a bug on https://entityframework.codeplex.com/WorkItem/Create and provide your query? – Pawel Dec 19 '13 at 14:22
  • I just did ! I will let you know if a solution is found ! – fharreau Dec 19 '13 at 17:54
  • Thanks but you need to show the query - otherwise we won't be able to investigate. I updated the answer to reflect that this is a regression from EF4 – Pawel Dec 19 '13 at 18:26
  • I'm not sure of what you want ... This is the query made in .NET : db.OLG_DEMANDE.Where(demande => demande.OLG_DEVIS.FirstOrDefault().IDREFSTATUTDEVIS == 1 && demande.IDDEMANDESTATUT == 2 && demande.IDSERVICEANNUEL == olgServiceAnnuel.IDSERVICEANNUEL); I will edit the question with it if it's what you want ! It failed when I want to count the size of the result set. – fharreau Dec 20 '13 at 16:08
  • Here you will find the tables impacted by the query : http://www.hostingpics.net/viewer.php?id=202323Capture.png – fharreau Dec 20 '13 at 16:19
  • @fharreau: This seems to have been fixed in EF6. I know that it is not terribly helpful if you are using Oracle since AFAIK currently there is no Oracle EF6 provider available (at least from Oracle - there might be one from DevArt). I asked the servicing team and they are considering porting this fix to EF5 but I don't have any definite answer whether it will happen and if it will, when this will happen. Sorry for not having better answer. – Pawel Dec 20 '13 at 17:54
  • Ok. Thank you Pawel for your time. – fharreau Dec 23 '13 at 10:58
  • Is this supposed to be fixed in EF now that Oracle have a provider for EF6? I have a similar issue here: http://stackoverflow.com/questions/29705013/linq-to-entities-query-grouping-outer-apply-oracle-11-2-0-3-0-does-not-suppor using the latest binaries. – philreed Apr 20 '15 at 11:29
  • @philreed - I don't know, sorry. – Pawel Apr 21 '15 at 19:48