Announcing ODP.NET 19.10 Release: New .NET 5 and Bulk Copy Support
By: Alex Keh
Tags: Oracle, Net5, Odpnet, Bulk Copy

Today, Oracle released ODP.NET 19.10 for .NET 5 (ODP.NET Core) and .NET Framework (managed ODP.NET) on NuGet Gallery. These releases include many new features developers have been asking for, including support for the recently released .NET 5. I highlight the new features in this blog post.

.NET 5

ODP.NET Core 19.10 supports .NET Runtime 5. Developers can use ODP.NET with .NET 5 in production now.

Bulk Copy

ODP.NET Core and managed ODP.NET now support bulk copy, which allows fast data transfer between .NET and Oracle databases equivalent to a direct path load. ODP.NET Core and managed ODP.NET support the same bulk copy APIs as unmanaged ODP.NET, which makes porting existing apps easier. These APIs are documented in the latest ODP.NET Developer’s Guide.

Oracle Data Type Deserialization into DataSet and DataTable

Due to a recent Microsoft change in all .NET versions to enhance application security, the allowed DataSet and DataTable data types that can be deserialized are now restricted by default. This change applies to .NET 5 and new updates in .NET Core and .NET Framework. If your DataSets and DataTables use Oracle data types with one of these new .NET versions, then you will have to upgrade to ODP.NET 19.10 and either add a small code change to your app or modify your .NET configuration file.

The code change to enable Oracle provider type deserialization is a new AddOracleTypesDeserialization method in the OracleConfiguration class. This new method is called to add ODP.NET-specific data types to the “allow” list so that they can be deserialized into DataSet or DataTable. If an attempt is made to deserialize ODP.NET-specific types without adding them to the “allow” list, an ODP.NET type initializer exception will be encountered.

If the app or third-party software you use adds data types to the allow list as well, be careful not to overwrite the ODP.NET allowed types. Be sure to only append to the allow list.

You can use the method when your app starts up, such as via the following C# call:

OracleConfiguration.AddOracleTypesDeserialization();

This new capability is available in ODP.NET Core, managed, and unmanaged providers.

KeepAlive for non-Windows platforms

Starting in ODP.NET Core 19.10, KeepAlive is supported on non-Windows operating systems, such as Oracle Linux. For these non-Windows operating systems, .NET Core 3 or higher is required. In previous releases, ODP.NET supported KeepAlive for Windows platforms only.

KeepAlive is used to prevent an idle TCP connection from being killed, such as by a firewall. In some cloud deployments, this idle TCP connection timeout cannot be changed. KeepAlive will keep the connection alive by periodically sending a probe packet with no data in it and the ACK flag turned on.

ODP.NET KeepAlive APIs include the following OracleConnection properties: KeepAlive, KeepAliveInterval, and KeepAliveTime.

Suppress GetDecimal Invalid Cast Exception

The SuppressGetDecimalInvalidCastException property has been added to the OracleDataReader and OracleDataAdapter classes in ODP.NET 19.10. It specifies whether to suppress the InvalidCastException and

return a rounded-off 28 precision value if the Oracle NUMBER value has more than 28 precision. This property is available in core, managed, and unmanaged.

Bug Fixes

This release includes a number of bug fixes, of course. You will find them documented in the NuGet package README.

Coming Soon: Oracle Entity Framework Core 5

This release does not include the Oracle EF Core 5 provider. However, it does lay the groundwork for its eventual support. The Oracle .NET team is on track to deliver the EF Core 5 provider in December or January.

Conclusion

In the ODP.NET 19.10 release, the Oracle .NET team has delivered numerous capabilities developers have asked for. We will continue that trend in our upcoming releases.