Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OracleManaged Migrations fail with runtime Exceptions #890

Closed
cgibbons opened this issue May 29, 2018 · 7 comments
Closed

OracleManaged Migrations fail with runtime Exceptions #890

cgibbons opened this issue May 29, 2018 · 7 comments
Assignees
Labels
db:oracle Oracle database specific investigation-needed
Milestone

Comments

@cgibbons
Copy link

cgibbons commented May 29, 2018

When trying to migrate an oracle database with version 3.0, runtime exceptions occur. If using oraclemanaged the following exception occurrs

Unhandled Exception: System.TypeLoadException: Could not load type 'System.Security.Principal.WindowsImpersonationContext' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
   at OracleInternal.ConnectionPool.PoolManager`3.CreateNewPRThreadFunc(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

This is using the oracle beta driver that supports dotnet core.

If using the Devart DotConnect driver, it fails because it says it can't find the correct version of Devart.Data, even though I can see it in the output directory.

To repro this is a netcoreapp2.1 project with the following dependencies

<ItemGroup>
        <!--<PackageReference Include="Oracle.ManagedDataAccess" Version="12.2.1100" />-->
        <PackageReference Include="Oracle.ManagedDataAccess.Core" Version="2.12.0-beta2" />
        <PackageReference Include="FluentMigrator" Version="3.0.0" />
        <PackageReference Include="FluentMigrator.Console" Version="3.0.0" />
        <PackageReference Include="FluentMigrator.Runner" Version="3.0.0" />
        <PackageReference Include="FluentMigrator.Runner.Oracle" Version="3.0.0" />
</ItemGroup>
@cgibbons
Copy link
Author

This can also be recreated following your quickstart guide, but substituting in the oracle libraries instead.

@fubar-coder
Copy link
Member

It looks like it's using the .NET Framework version of the library. I'll take a look at it tomorrow.

@fubar-coder fubar-coder added the db:oracle Oracle database specific label May 29, 2018
@fubar-coder fubar-coder self-assigned this May 29, 2018
@cgibbons
Copy link
Author

I've also tried using the devart driver, but it's failing with assembly load exceptions. Do you want me to file that as a separate bug with repro steps? Or append it this one?

@cgibbons
Copy link
Author

cgibbons commented May 29, 2018

@fubar-coder you're right, I substituted the beta driver in place of the managed driver in the code and it runs fine. I'll submit a PR and you can choose to merge it if you'd like.

@fubar-coder
Copy link
Member

fubar-coder commented May 29, 2018

Please file a separate issue. A PR would be welcome. It's good that you were able to solve the problem.

@cgibbons
Copy link
Author

Here's the PR I've submitted. I've tested locally and I can now run oracle migrations as a dotnet core application. #891

@fubar-coder fubar-coder added this to the 3.1.0 milestone Jun 1, 2018
@fubar-coder
Copy link
Member

Oracle plans to release a non-beta version of the driver in Q3, but it's the only Oracle driver that works under Linux/MacOS. The console tool (Migrate.exe) is more Windows-centric and will therefore keep
using the standard Oracle ADO.NET library. The dotnet-fm is mostly used on non-Windows platforms and is therefore predestinated to use the new beta driver.

The statement from Oracle can be found on the Oracle website.

The console tool will switch to the new driver when it becomes stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
db:oracle Oracle database specific investigation-needed
Projects
None yet
Development

No branches or pull requests

2 participants