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

Database: Upgrade dependency packages (24.11) [STUD-69625] #433

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,6 @@ public AdoDotNetConnectionProperties(string providerName)
{
Debug.Assert(providerName != null);
_providerName = providerName;
var builder = new AttributeTableBuilder();
DataRow dr = null;
#if NETFRAMEWORK
var dataSet = ConfigurationManager.GetSection("system.data") as System.Data.DataSet;
dr = dataSet.Tables[0].NewRow();
dr[0] = "ODP.NET, Managed Driver";
dr[1] = ".Net Framework Data Provider for Oracle";
dr[2] = "Oracle.ManagedDataAccess.Client";
dr[3] = "Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342";

dr = dataSet.Tables[0].NewRow();
dr[0] = ".Net Framework Data Provider";
dr[1] = ".Net Framework Data Provider";
dr[2] = "Microsoft.Data.SqlClient";
dr[3] = "Microsoft.Data.SqlClient.SqlClientFactory, Microsoft.Data.SqlClient, Version=4.10.22031.3, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5";
#endif

#if NETCOREAPP
DbProviderFactories.RegisterFactory("Microsoft.Data.SqlClient", Microsoft.Data.SqlClient.SqlClientFactory.Instance);
Expand All @@ -113,12 +97,14 @@ public AdoDotNetConnectionProperties(string providerName)
{
factory = DbProviderFactories.GetFactory(providerName);
}
catch(Exception ex)
catch
{
if (dr != null && (string)dr[2] == providerName)
factory = DbProviderFactories.GetFactory(dr);
else
throw ex;
#if NETFRAMEWORK
if (!LegacyProviders.GetLegacyFactory(providerName, out factory))
throw;
#else
throw;
#endif
}
Debug.Assert(factory != null);
_connectionStringBuilder = factory.CreateConnectionStringBuilder();
Expand Down Expand Up @@ -435,6 +421,46 @@ public object GetPropertyOwner(PropertyDescriptor pd)
}
#endregion ICustomTypeDescriptor implementation

#if NETFRAMEWORK
private static class LegacyProviders
{
private static readonly Lazy<Dictionary<string, DataRow>> _LegacyProviders = new Lazy<Dictionary<string, DataRow>>(() => InitLegacyProviders());

private static Dictionary<string, DataRow> InitLegacyProviders()
{
var legacyConfig = new Dictionary<string, DataRow>();

var dataSet = ConfigurationManager.GetSection("system.data") as System.Data.DataSet;
var dr = dataSet.Tables[0].NewRow();
dr[0] = "ODP.NET, Managed Driver";
dr[1] = ".Net Framework Data Provider for Oracle";
dr[2] = "Oracle.ManagedDataAccess.Client";
dr[3] = typeof(OracleClientFactory).AssemblyQualifiedName;
legacyConfig.Add((string)dr[2], dr);

dr = dataSet.Tables[0].NewRow();
dr[0] = ".Net Framework Data Provider";
dr[1] = ".Net Framework Data Provider";
dr[2] = "Microsoft.Data.SqlClient";
dr[3] = typeof(SqlClientFactory).AssemblyQualifiedName;
legacyConfig.Add((string)dr[2], dr);

return legacyConfig;
}
internal static bool GetLegacyFactory(string providerName, out DbProviderFactory factory)
{
factory = null;
if (_LegacyProviders.Value.TryGetValue(providerName, out var factoryConfig))
{
factory = DbProviderFactories.GetFactory(factoryConfig);
return true;
}
else
return false;
}
}
#endif

private class KeyValuePropertyDescriptor : PropertyDescriptor
{
private PropertyDescriptor m_Property;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Platforms>AnyCPU;x86;x64</Platforms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="4.1.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1" />
<PackageReference Include="System.Data.Common" Version="4.3.0" />
<PackageReference Include="System.Data.Odbc" Version="5.0.0" />
<PackageReference Include="System.Data.OleDb" Version="5.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PackageReference Include="System.Activities" />
<PackageReference Include="UiPath.Workflow" />
<PackageReference Include="System.Activities.Core.Presentation" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.90" PrivateAssets="All" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="23.5.0" PrivateAssets="All" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: TAB / space misalignment

</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<Reference Include="System.Activities" />
Expand All @@ -23,7 +23,7 @@
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System.Windows.Forms" />
<PackageReference Include="Oracle.ManagedDataAccess" Version="19.20.0" PrivateAssets="All" />
<PackageReference Include="Oracle.ManagedDataAccess" Version="19.22.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Dialogs\DataConnectionConfiguration.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,17 @@
<Delete Files="@(PackageFilesToDelete)" ContinueOnError="WarnAndContinue" />
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="4.1.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1" />
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
<PackageReference Include="Oracle.ManagedDataAccess" Version ="19.20.0"/>
<PackageReference Include="Oracle.ManagedDataAccess" Version ="19.22.0"/>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'net461' ">
<PackageReference Include="System.Activities.ViewModels" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0-windows' or '$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.90" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="23.5.0" />
<PackageReference Include="System.Data.Odbc" Version="7.0.0" />
<PackageReference Include="System.Data.OleDb" Version="7.0.0" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageReference Include="Microsoft.Activities.Extensions" Version="2.0.6.9" />
<PackageReference Include="Microsoft.Activities.UnitTesting" Version="2.0.6.9" />
<PackageReference Include="Moq" Version="4.10.0" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.2" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
Expand Down
6 changes: 3 additions & 3 deletions Activities/Database/UiPath.Database/UiPath.Database.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<PackageReference Include="Oracle.ManagedDataAccess" Version="19.20.0" PrivateAssets="All" />
<PackageReference Include="Oracle.ManagedDataAccess" Version="19.22.0" PrivateAssets="All" />
<PackageReference Include="System.Resources.Extensions" Version="5.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0-windows' or '$(TargetFramework)' == 'net6.0'">
<PackageReference Include="System.Data.Odbc" Version="7.0.0" />
<PackageReference Include="System.Data.OleDb" Version="7.0.0" />
<PackageReference Include="UiPath.Workflow" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.90" PrivateAssets="All" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="23.5.0" PrivateAssets="All" />
Copy link
Collaborator

@sorinconstantin sorinconstantin Jul 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now that's a huge leap forward 🚀
I hope it doesn't add any breaking changes

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they changed the versioning system.. it jumps from 3.xx to 23.xx
https://www.nuget.org/packages/Oracle.ManagedDataAccess.Core/#versions-body-tab


</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="4.1.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.1" />
<PackageReference Include="UiPath.Activities.Api" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
Expand Down
Binary file not shown.
Binary file not shown.