Announcing ODP.NET 23c Dev Release

Alex Keh
Oracle Developers
Published in
9 min readJul 29, 2023

--

ODP.NET 23c Developer Release is now available for free on NuGet Gallery. Download ODP.NET Core for .NET (Core) or managed ODP.NET for .NET Framework. It’s a prerelease version that complements the Oracle Database 23c Free Developer Release. Because it is prerelease, be sure to check the prerelease box in the NuGet Package Manager if you are using Visual Studio.

This new ODP.NET version includes a multitude of .NET and Oracle database capabilities for developers. I’ve categorized them in three areas: new .NET development features, new database features, and new cloud features. Let’s take a look at each of them.

New Oracle .NET Developer Features

These new Oracle .NET features improve application performance, high availability, observability, and flexibility. Most of these features can be used with databases earlier than version 23.

Asynchronous programming

ODP.NET Core and managed ODP.NET now support the .NET Task Asynchronous Programming (TAP) model with Oracle Database 19c and higher. Using the async and await keywords, ODP.NET data access operations can be more responsive and easier to develop for asynchronicity on the client side. The TAP model is well known in the .NET developer community, making adopting asynchronous ODP.NET programming simple. Here’s a code sample demonstrating how to use it:

static async void Main()
{
OracleConnection oc = new OracleConnection(connectionString);

// Establish a connection, asynchronously
Task task = oc.OpenAsync(CancellationToken.None);

// Execute operation(s) that do not require the connection
Console.WriteLine(“Hello World”);
OracleCommand cmd = oc.CreateCommand();
cmd.CommandText = "select * from employees";

// "await" OpenAsync to complete before executing operations
// needing a connection
await task;

// Execute the command
OracleDataReader = await cmd.ExecuteReaderAsync();
}

Oracle Database Pipelining

TAP provides asynchronous execution on the client side. What about the database side? That’s where Oracle Database pipelining comes in. It enables asynchronous command execution on the database server side.

Database requests are sent and queued transparently even while ODP.NET awaits a database response. Pipelining improves overall app performance and allows database resources to be used more effectively. Databases do not need to wait for ODP.NET requests to complete before working on subsequent ODP.NET calls.

Because pipelining is a database feature, it requires Oracle Database 23c, which first introduced the feature. ODP.NET 23c managed and core drivers support database pipelining.

It is intended to be used alongside TAP. As such, pipelining employs the same TAP application programming interfaces (APIs). To enable pipelining in your .NET code, just set OracleConfiguration.Pipelining = true.

//Enabling Pipelining
OracleConfiguration.Pipelining = true;

OracleConnection oc = new OracleConnection(connectionString);
await oc.OpenAsync(CancellationToken.None);

OracleCommand cmd = oc.CreateCommand();
OracleCommand cmd2 = oc.CreateCommand();

cmd.CommandText = "update table1 set col1 = 1 where col2 = 2";
cmd2.CommandText = "update table2 set col3 = 3 where col4 = 4";

//Execute commands asynchronously with pipelining
Task<int> task = cmd.ExecuteNonQueryAsync(CancellationToken.None);
Task<int> task2 = cmd2.ExecuteNonQueryAsync(CancellationToken.None);

//Await the asynchronous tasks to complete
int updatedRows = await task;
int updatedRows2 = await task2;
Console.WriteLine(“Number updated rows: ” + updatedRows + “ and ” + updatedRows2);

Oracle Application Continuity

I’ve blogged about ODP.NET Application Continuity (AC) before in the context of the unmanaged driver. Now AC and Transparent AC have come to managed ODP.NET and ODP.NET Core in 23c.

In a nutshell, AC provides end-to-end high availability for your .NET application for both planned and unplanned outages. It masks those outages by recovering in-flight database sessions so that end users only notice a short delay, but no work disruption. The above linked blog post goes into more detail about AC.

To use AC or TAC with your .NET app, you just need to connect to Oracle Database 19c or higher with ODP.NET 23c. By default, ODP.NET enables AC via the connection string attribute Application Continuity = true.

Oracle Advanced Queuing and Transactional Event Queues

ODP.NET Core and managed ODP.NET now support Advanced Queuing (AQ) and Transactional Event Queues (TxEventQ) APIs that are used in modern applications, such as microservices. TxEventQ’s highly optimized and partitioned implementation leverages the functions of Oracle database so that producers and consumers can exchange messages at high throughput, by storing messages persistently, and propagate messages between queues on different databases. TxEventQ are a high performance partitioned implementation with multiple event streams per queue, while AQ is a disk-based implementation for simpler workflow use cases.

ODP.NET Core and managed ODP.NET developers can leverage the same APIs when working with either TxEventQ or AQ using Oracle Database 19c and higher. These are the same AQ APIs unmanaged ODP.NET uses, which makes migration to managed or core ODP.NET drivers straightforward.

The APIs themselves provide access to a robust and feature-rich message queuing systems integrated with Oracle database. They can be used with web, mobile, IoT, and other data-driven and event-driven applications to stream events or communicate with each other as part of a workflow.

OpenTelemetry

OpenTelemetry is a popular open-source observability framework for instrumenting, generating, collecting, and exporting telemetry data. It provides a common specification and protocol so that multiple services can furnish a unified version of traces, metrics, and logs.

Numerous managed ODP.NET and ODP.NET Core APIs have been instrumented to support OpenTelemetry observability and standards in this new 23c dev release. Developers and operators can customize the ODP.NET metrics collected using the ODP.NET OpenTelemetry NuGet package.

With OpenTelemetry support, monitoring, tracking, and analyzing how ODP.NET operations interact in cloud computing, microservices and distributed systems becomes easier using this industry standard.

Enhanced Transaction Management Options (a.k.a. Disable Auto-Commit)

By default, ODP.NET auto-commits after every SQL operation execution outside of a transaction. Managed ODP.NET and ODP.NET Core now allow disabling auto-commit so that SQL statements can be executed after an explicit commit without requiring a transaction.

To support the feature, the OracleConnection class adds new APIs to manage commands, such as OracleConnection.Commit and OracleConnection.Save. These new capabilities provide ODP.NET developers flexible transaction management options without auto-commit.

New Oracle Database 23c Features

Oracle Database 23c and ODP.NET 23c introduce a number of new database capabilities that .NET developers can take advantage of.

JSON Relational Duality

Oracle Database 23c JSON Relational Duality is a revolutionary feature that allows data to be stored in relational tables in a highly efficient normalized format, but also accessible as JSON documents at the same time. All ODP.NET provider types (core, managed, and unmanaged) support this new capability. I described ODP.NET JSON Relational Duality in more detail in a previous blog post.

SQL Boolean column data type

All ODP.NET 23c provider types can fetch and bind the new Boolean database column. Apps can use Booleans with the native ODP.NET OracleBoolean data type. This enhancement makes working with Oracle Boolean columns easier for developers and complements existing ODP.NET PL/SQL Boolean data type support, which use the same APIs.

SQL Domains

A SQL domain is a dictionary object that belongs to a schema and encapsulates a set of optional properties and constraints for common values, such as credit card numbers or email addresses. After you define a SQL domain, you can define table columns associated with that domain, thereby explicitly applying the domain’s optional properties and constraints to those columns.

With SQL domains, you can centrally define how you intend to use data. They make it easier to ensure you handle values consistently across applications and improve data quality.

All ODP.NET 23c provider types support using SQL domains and retrieving SQL domain schema and name information.

Annotations

Oracle Database annotations enable storing and retrieving metadata about database objects. They are either name-value pairs or only a name. Annotations are free-form text fields that applications can use to customize business logic or user interfaces.

Annotations help you use database objects in the same way, across all applications. This simplifies development and improves data quality.

All ODP.NET provider types support Oracle Database annotations.

Longer passwords

Starting with Oracle Database 23c, the maximum password length has been increased to 1024 bytes. All ODP.NET 23c provider types support this new maximum.

The increased maximum benefits multi-byte character set users. Multi-byte character sets use more than one byte per character. The new maximum length also aligns with Oracle Cloud password maximum lengths.

Transport Layer Security 1.3

ODP.NET supports Transport Layer version (TLS) 1.3 for all provider types. TLS is used to encrypt data and authenticate connections. TLS 1.3 offers improved security and performance over TLS 1.2.

Sharding Split Partitionset

ODP.NET Core and managed support sharding split partitionset events in version 23. A split partitionset is an operation on the sharding database performed when moving data within a specified super sharding key to a different shardspace.

ODP.NET connection pools receive database events about data in a chunk being split and moved across these partition sets. The provider updates its sharding topology transparently so that end users are dispensed the correct connection to use without custom app code necessary.

Programmatic Database Startup and Shutdown Operations

Users with database administrator privileges can use the OracleDatabase class to startup or shutdown a database instance with managed ODP.NET and ODP.NET Core. This feature was already available in unmanaged ODP.NET.

New Cloud Features

ODP.NET 23c includes several enhancements to streamline usage in the cloud and across multiple cloud vendor environments. These new features aren’t available in the first 23c dev release, but will be available soon.

Centralized configuration providers

Managed ODP.NET and ODP.NET Core 23c will have a new capability to retrieve application configuration data from a centralized and secure on-premises, Oracle Cloud Infrastructure, or Azure location. This store typically uses a JSON format (except with Azure) and contains data, such as connection string and tuning parameters.

Centralized application configuration makes management and cloning ODP.NET setups simpler. It suits modern architectures, such as microservices and serverless deployments. Provider configuration can be stored in one of the following locations:

  1. Microsoft Azure

The ODP.NET Azure configuration provider uses Azure App Configuration and Azure Key Vault to store database connection information.

2. Oracle Cloud Infrastructure (OCI)

The ODP.NET OCI configuration provider uses OCI Object Storage and OCI Vault to store database connection information in a JSON configuration file.

3. Local file system

The file configuration provider stores database connection information in a JSON configuration file on the local file system. It can be used with web and desktop apps, such as Microsoft Internet Information Services (IIS).

Azure Active Directory single sign-on

ODP.NET 23c will be able to log into Oracle databases using a Microsoft Entra ID (a.k.a Azure Active Directory) OAuth 2.0 access token. Users could sign-on once with Azure Active Directory, acquire the token, and access their on-premises and cloud-based Oracle databases with managed ODP.NET and ODP.NET Core 23c. This multicloud capability eases authentication and authorization between Azure Active Directory and Oracle databases by simplifying .NET user access and management.

Oracle Identity and Access Management single sign-on

ODP.NET will support Oracle Identity and Access Management (IAM) cloud service single sign-on for unified identity across Oracle cloud services, including Oracle Database Cloud Services. Managed ODP.NET and ODP.NET Core 23c will use the same Oracle IAM credentials for authentication and authorization to the Oracle Cloud and Oracle cloud databases, now with IAM single sign-on tokens.

This capability allows identity to be propagated to all services Oracle IAM supports including federated users via Azure Active Directory and Microsoft Active Directory. A unified identity makes user management and account management easier for administrators and end users.

As you can see, ODP.NET adds features for all types of modern data access usage scenarios in version 23. For more details, the ODP.NET 23c Developer’s Guide is a great resource to learn more about each of these features and how to use them.

Give these new features a try and let us know your feedback.

--

--

Alex Keh
Oracle Developers

Alex Keh is a senior principal product manager at Oracle focusing on data access and database integration with .NET, Windows, and the cloud.