Oracle .NET Application Continuity
Oracle .NET Application Continuity
Search
Listen Share
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.
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.
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.
In fact, ZERO application code changes are necessary to use AC. ODP.NET actually
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.
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;
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.
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.
Follow
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
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
Andrew Harry
Jul 22, 2021
Will this work with EF Core? It looks like that is using 'managed ODP.NET' underhood?
1 reply Reply
May 19 5 2
Jun 14 53 1
Mar 26 14
Apr 10
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
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
6d ago 2
Nipuni Sithara
Jan 26 1
Mar 6 5