Hello,
I'm checking the behaivour of the managed odp.net versus no managed odp.net version and I've found a memory and handles increase on the managed version. For checking I've uses two scenarios in a retry connection loop:
1. Error user/password.
2. Unplup computer from Network / switch off Wifi.
In both scenarios using procexp64.exe on "Performance" tab to check memory and handles.
Results:
With the no managed driver memory and handles works as spected.
With the managed driver memory and handles increase in each iteration.
The code I use for testing is the following:
| class Program |
| { |
| static void Main(string[] args) |
| { |
| for (int i = 0; i < 10000; i++) |
| { |
| DatabaseConnection @base = new DatabaseConnection("Oracle.DataAccess.Client", "User Id=mlxnouser; Password=nopassword; Data Source=GIJITSW04/orclmlx"); |
| try |
| { |
| @base.Open(); |
| } |
| catch (Exception ex) |
| { |
| Console.WriteLine(ex.Message); |
| } |
| finally |
| { |
| @base.Close(); |
| } |
| Console.WriteLine("Press key to exit."); |
| private class DatabaseConnection |
| { |
| protected DbConnection dataBaseConnection; |
| protected DbProviderFactory dataBaseProvider; |
| public DatabaseConnection(string databaseProviderAssembly, string connectionString) |
| { |
| dataBaseProvider = DbProviderFactories.GetFactory(databaseProviderAssembly); |
| dataBaseConnection = dataBaseProvider.CreateConnection(); |
| dataBaseConnection.ConnectionString = connectionString; |
| } |
| public void Open() |
| { |
| dataBaseConnection.Open(); |
| } |
| public void Close() |
| { |
| dataBaseConnection.Close(); |
| } |
In my computer is installed the no managed driver. For testing managed driver i downloaded from nuget and i change my App.config with the following code:
<system.data>
<DbProviderFactories>
<remove invariant="Oracle.DataAccess.Client" />
<add name="Oracle.DataAccess.Client" invariant="Oracle.DataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data>
I hope that can be helpfull.
Best Regards
Jose Luis Vazquez