Import from EDMX oracle managed provider not recognized

Posts   
 
    
MizardX
User
Posts: 2
Joined: 03-Dec-2020
# Posted on: 03-Dec-2020 00:36:12   

When importing an EDMX file with the provider "Oracle.ManagedDataAccess.Client" you get an error saying "The specified store provider cannot be found in the configuration, or is not valid.".

Exception message:
-------------------------------
Exception type: ImporterAbortException
The file C:\...\MyDB.edmx could not be loaded.

Inner exception message:
-------------------------------
Exception type: ArgumentException
The specified store provider cannot be found in the configuration, or is not valid.

Inner exception message:
-------------------------------
Exception type: ArgumentException
Unable to find the requested .Net Framework Data Provider.  It may not be installed.
The file C:\utv\Agio\Giron\GironDAL\GironDB.edmx could not be loaded.
The specified store provider cannot be found in the configuration, or is not valid.
Unable to find the requested .Net Framework Data Provider.  It may not be installed.

LLBLGen Pro version 5.7. Build 5.7.1
-----[Core exception]--------------------
   at SD.LLBLGen.Pro.Importers.EdmxImporter.EdmxToImportableHelper.InitializeContext(String fileName)
   at SD.LLBLGen.Pro.Importers.EdmxImporter.EdmxToImportableHelper..ctor(String fileName, String entryExeLocation)
   at SD.LLBLGen.Pro.Importers.EdmxImporter.ImportInformationRetriever.InitializeImportableHelper()
   at SD.LLBLGen.Pro.Importers.EdmxImporter.ImportInformationRetriever.GetFirstLevelInfo()
   at SD.LLBLGen.Pro.Importers.EdmxImporter.ImportInformationRetriever.GetFirstLevelInfo()
   at SD.LLBLGen.Pro.ApplicationCore.Extensibility.ImporterBase`1.GetFirstLevelInfo()
   at SD.LLBLGen.Pro.Gui.Forms.ImportDataRetrievalWizard.RefreshFirstLevelData()
-----[InnerException]--------------------
   at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)
   at System.Data.EntityClient.EntityConnection.ChangeConnectionString(String newConnectionString)
   at System.Data.Objects.ObjectContext.CreateEntityConnection(String connectionString)
   at System.Data.Objects.ObjectContext..ctor(String connectionString)
   at SD.Tools.Edmx.ObjectContextExtended..ctor(String connectionString, String ssdlFileName)
   at SD.Tools.Edmx.EdmxLoader.ProduceObjectContextFromConnectionString(String connectionString)
   at SD.Tools.Edmx.EdmxLoader.ProduceObjectContextFromEdmx(String edmxFileName)
   at SD.LLBLGen.Pro.Importers.EdmxImporter.EdmxToImportableHelper.InitializeContext(String fileName)
-----[InnerException]--------------------
   at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
   at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)

I tried changing the EDMX file to use provider "Oracle.DataAccess.Client", but then I got other errors.

If I modify the SD.LLBLGen.Pro.Importers.dll assembly, to include case "Oracle.ManagedDataAccess.Client": in the ProviderNameToDriverID() method and recompile, everything loads fine.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 03-Dec-2020 10:13:04   

Hmm, I think this is because we don't support Oracle for Entity Framework (Core) so importing that information would never be sufficient (as importing the oracle meta data wouldn't be usable). I recon you imported it into a project to use a different orm?

Frans Bouma | Lead developer LLBLGen Pro
MizardX
User
Posts: 2
Joined: 03-Dec-2020
# Posted on: 03-Dec-2020 12:59:42   

I am just experimentation so far. I have only gotten so far as importing the EDMX structure, with a minor modification to a DLL. Next step is the code generation.

We have a legacy Oracle 12c database mapped with EDMX in Entity Framework 6. We prefer database-first because of the legacy database, and it is important to keep the database schema updates compatible with other systems using the same database.

I wanted to try to replace the EDMX with some modeling tool that would support database-first, but allow us to move towards .NET Core.

Normal EF Core scaffolding for Oracle is a no go, since you can't specify the names of the generated columns. It would require us to rewrite the whole BLL and DAL. The EF Core Power Tools does not allow specifying names for navigation properties. LLBLGen Pro seems the most promising so far, if I can get it to work as I want it.

It might be that we still have to wait for the next version of the Oracle bindings for EF Core.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 03-Dec-2020 13:43:40   

At the moment Oracle support for EF Core in our system isn't available. We are looking at supporting it in v5.8 which is scheduled for early next year, but we have to solve a problem with respect to mapping differences: a NUMBER(10,0) is returned by ODP.NET as an Int64, so we map that through database first as an Int64, however the oracle provider for EF Core / EF 6 maps NUMBER(10,0) as Int32. Currently we don't have the ability to define different mappings per framework for a database (which are just tables). If we can get it in for v5.8, supporting oracle for EF Core is straight forward. But as said, it's not done yet, so can't make promises.

If you add the guid for the oracle driver to the templatebindings/presets for ef core you will likely get output, but you also will run into the problem mentioned above (I think there are other types as well which are different. Why they did that is beyond me).

Frans Bouma | Lead developer LLBLGen Pro