I have 2 data layer DLL projects. One is hitting Oracle tables and the other SQL Server. Each one works on their own when used in separate projects.
When I make a project that includes both DLL's I get the following error when an Oracle table is queried:
Schema specified is not valid. Errors: Model.ssdl(2,48) : error 0172:
All SSDL artifacts must target the same provider. The Provider 'Oracle.ManagedDataAccess.Client' is different from 'Oracle.ManagedDataAccess.Client' that was encountered earlier. Model.ssdl(2,81) : error 0169: All SSDL artifacts must target the same provider. The ProviderManifestToken '2008' is different from '11.2' that was encountered earlier.
The crazy thing is, in my 1 project that includes 2 data layers projects if I comment out a function that has usage of the SQL Server data layer (even though it never actually gets called at this time) then it works. Somehow the presence of it's code causes this error above. How can I mix SQL Server and Oracle entity framework?
My code started to work when I moved the Oracle DB connection and query into a separate method.
I was under the impression that I should keep the Oracle connection open for all queries because it would be inefficient otherwise, but apparently this is actually done automatically under the hood. Now that the scope of the two connections are entirely separate it is working.
Why? No idea...
try with devart dotConnect:
Simultaneous Oracle and SQL Server Support in Entity Framework with Designer Generated Objects
Using Oracle and MS SQL Server in Entity Framework applications
simultaneously
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With