developers

    Forum Stats

  • 3,873,864 Users
  • 2,266,625 Discussions
  • 7,911,646 Comments

Discussions

Does entityfraemwork core watch changes in tnsnames.ora?

Bjego
Bjego Member Posts: 33 Red Ribbon

Hey guys,

we want to mount our latest tnsnames.ora into our pods in kubernetes.

The filemount , maybe implemented as a sidecar, shold always serve the latest tnsnames.ora and the configuration:

 OracleConfiguration.TnsAdmin 

is going to point to that directory.


Is there any chance that ef core recognises the change and connects to e.g. new ipadresses, without stopping and rebooting the container?


Best regards

Best Answer

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 3,153 Employee
    Answer ✓

    The way I expect most customers would solve this challenge is to provide an address list in tnsnames.ora for ODP.NET to try to connect to. As long as all the possible "new" IPs are in this list, it will connect to one of them.

    Otherwise, ODP.NET is not constantly checking the tnsnames.ora file for changes.

    Even if it did, there's the challenge of what should ODP.NET do with existing connection pools when the tnsnames.ora file changes. It could let existing connections continue on or it could remove those connections immediately, leaving connected users disconnected mid-transaction, then rebuild the pool with the new connection info.

    Usually when the IP address changes, that indicates the DB node or machine has been brought offline and DB traffic should be redirected to the remaining nodes or new machine. In those cases, I would recommend using Fast Connection Failover. ODP.NET will get these "down" messages, close connections to the offline instance, and open connections to any surviving instances. Admins can set a drain timeout so that existing connections will not be terminated immediately. Instead, they will be given time to complete their tasks gracefully. During the drain timeout period, not new connections can be made to the node being brought offline.

    An option for unplanned downtime is to use Application Continuity, which actually can save transactional work in unplanned outage scenarios. It works with and without connection pooling. Right now, it is supported with unmanaged ODP.NET, but we are porting the support to managed ODP.NET and ODP.NET Core.

Answers

  • Alex Keh-Oracle
    Alex Keh-Oracle Posts: 3,153 Employee
    Answer ✓

    The way I expect most customers would solve this challenge is to provide an address list in tnsnames.ora for ODP.NET to try to connect to. As long as all the possible "new" IPs are in this list, it will connect to one of them.

    Otherwise, ODP.NET is not constantly checking the tnsnames.ora file for changes.

    Even if it did, there's the challenge of what should ODP.NET do with existing connection pools when the tnsnames.ora file changes. It could let existing connections continue on or it could remove those connections immediately, leaving connected users disconnected mid-transaction, then rebuild the pool with the new connection info.

    Usually when the IP address changes, that indicates the DB node or machine has been brought offline and DB traffic should be redirected to the remaining nodes or new machine. In those cases, I would recommend using Fast Connection Failover. ODP.NET will get these "down" messages, close connections to the offline instance, and open connections to any surviving instances. Admins can set a drain timeout so that existing connections will not be terminated immediately. Instead, they will be given time to complete their tasks gracefully. During the drain timeout period, not new connections can be made to the node being brought offline.

    An option for unplanned downtime is to use Application Continuity, which actually can save transactional work in unplanned outage scenarios. It works with and without connection pooling. Right now, it is supported with unmanaged ODP.NET, but we are porting the support to managed ODP.NET and ODP.NET Core.

  • Bjego
    Bjego Member Posts: 33 Red Ribbon

    Thank you for this information @Alex Keh-Oracle, as we are migrating to RAC at the moment, maybe this is an helpful information for our admins to tweak the setup a bit.

    I think they already provided a "Scan" server in front of the rac servers.. Maybe I'm telling incorrect stuff as I am just a user.

    Anyway - thanks for your feedback - I'll forward this message to them!

developers