0% found this document useful (0 votes)
4 views14 pages

Oracle .NET Application Continuity

The document provides an introduction to Oracle .NET Application Continuity (AC) and offers sample code for users to test its functionality in a proof of concept. AC enhances database application availability by allowing automatic replay of transactions during outages without requiring code changes. The article includes setup instructions for both the ODP.NET sample application and the database environment needed to utilize AC effectively.

Uploaded by

OscarRamirez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views14 pages

Oracle .NET Application Continuity

The document provides an introduction to Oracle .NET Application Continuity (AC) and offers sample code for users to test its functionality in a proof of concept. AC enhances database application availability by allowing automatic replay of transactions during outages without requiring code changes. The article includes setup instructions for both the ODP.NET sample application and the database environment needed to utilize AC effectively.

Uploaded by

OscarRamirez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Oracle .NET Application Continuity — Getting Started | by Alex Keh |... https://medium.com/oracledevs/oracle-net-application-continuity-getting...

Open in app Sign up Sign in

Search

Oracle Developers · Follow publication

Oracle .NET Application Continuity — Getting


Started
4 min read · Jun 26, 2020

Alex Keh Follow

Listen Share

1 de 14 03/07/2025, 01:50 p.m.


Oracle .NET Application Continuity — Getting Started | by Alex Keh |... https://medium.com/oracledevs/oracle-net-application-continuity-getting...

Oracle Transparent Application Continuity

One frequent request I hear is for ODP.NET sample code using Oracle Application
Continuity (AC). It usually comes from customers trying ODP.NET AC for the first
time. I put together a running ODP.NET AC code sample for anyone to try in a proof
of concept evaluation to get started. The sample code can be run against a single
instance database to keep the setup simple. The comments section contains all the
client side and database configuration instructions needed to successfully test AC
out.

2 de 14 03/07/2025, 01:50 p.m.


Oracle .NET Application Continuity — Getting Started | by Alex Keh |... https://medium.com/oracledevs/oracle-net-application-continuity-getting...

2024 Update: Managed ODP.NET and ODP.NET Core 23c now support AC and
Transparent Application Continuity (TAC) with Oracle Database 19c and higher. This
blog, the sample code, and the ODP.NET 23c Application Continuity documentation
have been updated to reflect the new support.

Oracle Application Continuity Introduction


Of course, if you’re not familiar with Oracle Application Continuity, you are
wondering what it is. Let me introduce the feature and why so many Oracle
Database users and .NET developers want to adopt it.

For several years, Oracle has been talking about continuous availability rather than
just high availability. Continuous database availability is when planned and
unplanned outages are hidden from the end user. While software and hardware
outages still occur, systems are resilient such that the end user experiences no
errors, loses no work, and continues on using the database application. The end
user need not be aware that events, such as a software update, machine outage, or
load imbalance in the database tier occurred.

On the database side, Oracle Real Application Clusters (RAC) and Oracle Data Guard
have been around a long time to provide robust database availability solutions. A
remaining architectural availability challenge is to ensure the client application
remains just as available when an outage in the database tier occurs. Availability
must be end-to-end to be truly effective. Equally important, maintaining availability
should not require code nor configuration changes when the application or
database business logic changes. That’s where AC comes in and shines.

AC enables database requests to automatically replay transactional or non-


transactional operations in a non-disruptive and rapid manner in the event of a
severed database session, which results in a recoverable error. AC improves the end
user experience by masking planned and unplanned outage errors. Applications can
be developed without complex logic to handle exceptions, while automatically
replaying database operations upon a recoverable error.

In fact, ZERO application code changes are necessary to use AC. ODP.NET actually

3 de 14 03/07/2025, 01:50 p.m.


Oracle .NET Application Continuity — Getting Started | by Alex Keh |... https://medium.com/oracledevs/oracle-net-application-continuity-getting...

enables it on the client side by default via the connection string attribute:

Application Continuity=true

Any existing ODP.NET application can be AC-enabled as soon as the database server
is configured for AC.

Without AC, it is almost impossible to mask outages in a safe and reliable manner.
The database may lose state changes the client attempts to make. Even worse, the
end user may not know whether a transaction committed because the commit
message was not durable.

AC is available with Oracle RAC, Oracle RAC One Node, Oracle Active Data Guard,
and both dedicated and shared Oracle Autonomous Database.

Testing ODP.NET Application Continuity


If you would like to try ODP.NET AC yourself, use the sample code I linked to at the
beginning of this post. The code uses the well-known Oracle HR sample schema.
The app loops infinitely incrementing one employee’s salary in a local transaction.

While the app runs, connect to the database separately as an administrator.


Intermittently execute the following command (after adding your database service
name):

Execute dbms_service.disconnect_session(‘your service name’,


dbms_service.immediate );

This command disconnects the user’s session, simulating a recoverable error


condition. With AC enabled, the end user observes no error message, only a slight
delayed execution. The app continues on without noticeable interruption to the end
user’s work. AC has masked the outage from the end user and completes the
transaction.

Setting up the ODP.NET AC Sample App


1. Download the ODP.NET sample code into a .NET console project. Use .NET
Framework for managed ODP.NET or unmanaged ODP.NET. Use .NET (Core) for
ODP.NET Core.

4 de 14 03/07/2025, 01:50 p.m.


Oracle .NET Application Continuity — Getting Started | by Alex Keh |... https://medium.com/oracledevs/oracle-net-application-continuity-getting...

2. Modify the following connection string attributes, User Id, Password, and Data
Source as needed.

3. If you are using unmanaged ODP.NET, comment out the following line, such as:

//using Oracle.ManagedDataAccess.Client;

Then uncomment the following line, such as:

using Oracle.DataAccess.Client;

That’s all for the .NET code setup! It’s pretty simple. Now, run the app and follow the
runtime instructions in the code comments to see ODP.NET AC and TAC in action.

Be sure to use managed ODP.NET or ODP.NET Core 23c or higher, which supports
AC. For unmanaged ODP.NET, use version 12.2 or higher. I recommend using the
highest ODP.NET version possible as we are constantly improving AC capabilities
and fixing bugs.

Setting up the Database


1. Connect as a database administrator to setup the HR schema if not already
present. Some Oracle database server installations include the create script in
the following directory: %ORACLE_HOME%
\demo\schema\human_resources\hr_main.sql

2. Run “GRANT execute on DBMS_APP_CONT to HR;” so that ODP.NET can


determine the in-flight transaction status following a recoverable error.

AC was first introduced in Oracle Database 12c. I recommend using the highest
Oracle Database version available as well.

Conclusion
That’s it! You are now ready to run the app and test ODP.NET AC out.

As I said before, no application code changes are needed. The database setup
instructions are simple. You can turn AC on for existing apps by enabling it on the
database server.

5 de 14 03/07/2025, 01:50 p.m.


Oracle .NET Application Continuity — Getting Started | by Alex Keh |... https://medium.com/oracledevs/oracle-net-application-continuity-getting...

Application Continuity Oracle Odpnet High Availability

Follow

Published in Oracle Developers


41K followers · Last published 6 days ago

Aggregation of articles from Oracle engineers, Groundbreaker Ambassadors, Oracle ACEs, and Java
Champions on all things Oracle technology. The views expressed are those of the authors and not
necessarily of Oracle.

Follow

Written by Alex Keh


250 followers · 21 following

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

Responses (1)

Write a response

What are your thoughts?

6 de 14 03/07/2025, 01:50 p.m.


Oracle .NET Application Continuity — Getting Started | by Alex Keh |... https://medium.com/oracledevs/oracle-net-application-continuity-getting...

Andrew Harry
Jul 22, 2021

Will this work with EF Core? It looks like that is using 'managed ODP.NET' underhood?

1 reply Reply

More from Alex Keh and Oracle Developers

In Oracle Developers by Alex Keh

All About ODP.NET 23.8


The latest version of ODP.NET, 23.8, is available for free download and deployment. Simply go
to NuGet Gallery and select either the core…

May 19 5 2

7 de 14 03/07/2025, 01:50 p.m.


Oracle .NET Application Continuity — Getting Started | by Alex Keh |... https://medium.com/oracledevs/oracle-net-application-continuity-getting...

In Oracle Developers by Shadab Mohammad

Oracle Database 23ai Running in an Apple Container—First Look


Apple made waves at WWDC this year with the introduction of Apple Containers, a new way
to run Linux containers natively on macOS…

Jun 14 53 1

8 de 14 03/07/2025, 01:50 p.m.


Oracle .NET Application Continuity — Getting Started | by Alex Keh |... https://medium.com/oracledevs/oracle-net-application-continuity-getting...

In Oracle Developers by Christopher Jones

How to create n8n workflows that connect to Oracle Database


The n8n workflow automation tool describes itself as “a workflow automation tool that
combines AI capabilities with business process…

Mar 26 14

In Oracle Developers by Alex Keh

Using Oracle Database with ASP.NET Core Identity


Step by step guide on how to setup Oracle database as the data store for ASP.NET Core
Identity

Feb 16, 2022 60

See all from Alex Keh

See all from Oracle Developers

9 de 14 03/07/2025, 01:50 p.m.


Oracle .NET Application Continuity — Getting Started | by Alex Keh |... https://medium.com/oracledevs/oracle-net-application-continuity-getting...

Recommended from Medium

In DevOps.dev by Adem KORKMAZ

Advanced Oracle PL/SQL Explained Simply


Packages, Procedures, Functions, Ref Cursors, and Loops

Apr 10

10 de 14 03/07/2025, 01:50 p.m.


Oracle .NET Application Continuity — Getting Started | by Alex Keh |... https://medium.com/oracledevs/oracle-net-application-continuity-getting...

The Latency Gambler

We Cut 80% of Our Query Time by Using This Little-Known SQL Pattern
A simple CTE trick that saved us from a major scaling disaster

May 5 1.6K 36

11 de 14 03/07/2025, 01:50 p.m.


Oracle .NET Application Continuity — Getting Started | by Alex Keh |... https://medium.com/oracledevs/oracle-net-application-continuity-getting...

Venkataramana

Using Azure Blob Storage with .NET 6 to Store Images and Files—A
Complete Guide
Learn how to upload, retrieve, and manage files in Azure Blob Storage using .NET 6 —with
real-world code examples and best practices.

May 7

Vijay Gadhave

Nested vs. Normalized vs. Denormalized in BigQuery


Note: If you’re not a medium member, CLICK HERE

6d ago 2

12 de 14 03/07/2025, 01:50 p.m.


Oracle .NET Application Continuity — Getting Started | by Alex Keh |... https://medium.com/oracledevs/oracle-net-application-continuity-getting...

Nipuni Sithara

Using Stored Procedures with Entity Framework Core—Code First


Approach
In Code-First approach, the database is typically created and managed from the code,
including tables, relationships, and initial data…

Jan 26 1

13 de 14 03/07/2025, 01:50 p.m.


Oracle .NET Application Continuity — Getting Started | by Alex Keh |... https://medium.com/oracledevs/oracle-net-application-continuity-getting...

In Oracle Developers by Veronica Dumitriu

The Power of Sparse Vectors in Oracle Database


A vector is a mathematical representation of data, structured as an ordered list of numbers,
where each number represents a dimension…

Mar 6 5

See more recommendations

14 de 14 03/07/2025, 01:50 p.m.

You might also like