Forum Stats

  • 3,875,465 Users
  • 2,266,926 Discussions
  • 7,912,225 Comments

Discussions

.Net core / .Net Framework Entity Framework with Failover

User_1ALT2
User_1ALT2 Member Posts: 5 Green Ribbon

I am trying to research how to get Entity Framework connection string that supports failover.

With TNSNAMES.ora and the Unmanaged client, failover could be configured to a single DataSource name.

I have read through some of the documentation about attaching a failover event, but isn't that after the event has happened? I need to know when it happens and how to point it at another server/database.

Shouldn't the connection string have some information about the failover server? IE: Sql Server and Failover partner.

Thanks, any direction provided would be a big help.

Peter

Answers

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 3,154 Employee
    edited Sep 18, 2021 3:42PM

    Which failover are you trying to configure?

    There's several different Oracle technologies that support high availability failover, depending on the failover scenario you are trying to support.

    The most common is Fast Connection Failover, which is on by default on the client side. It does need to be enabled on the DB side, however. The directions how are different depending on the DB version you are using.

    Oracle has been auto-enabling a lot of the failover technologies on the client side so that developers don't have to make code changes to use them. ODP.NET will check which HA features are enabled on the DB server side when connecting and use only those.

    In most cases, you shouldn't need to code anything yourself in case of an planned failover. ODP.NET will handle "migrating" connections to new instances given a long enough drain timeout. Unplanned failures are a little trickier. In those cases, we recommend using Application Continuity, which is available if you use RAC, RAC One Node, ADG, or Autonomous DB.

    On the DB side, the DBA will enable Fast Application Notification to send messages to clients when DB nodes go up and down. ODP.NET will then know which DB server machines are available to dispense connections to and which ones to dispose immediately.