Search code examples
c#oracle-databaseoracle-manageddataaccess

ONSException Exception - no nodes configured


When opening an Oracle Connection, I see a few Exceptions in output window.

Exception occurred: "OracleInternal.NotificationServices.ONSException" in Oracle.ManagedDataAccess.dll

I updated the Oracle Management Driver to the latest Version, but still get it.

I did not configure any Load Balancing or ONS Service on the machine. The tracelog showed the following exception:

2019-09-10 10:47:12.500352 TID:5   (PRI) (SVC) (ERR) OracleONSNotificationManager.RegisterForNotification() (txnid=n/a) OracleInternal.NotificationServices.ONSException: ONS: No node lists were configured
   bei OracleInternal.NotificationServices.ONS..ctor(String config)
   bei OracleInternal.ServiceObjects.OracleONSNotificationManager.RegisterForNotification(String serviceName, String databaseName, Int32 timeout, String eventTypeFromDb, String onsConfigFromDb)

The error will be thrown when I open the Connection like that:

Connection = new OracleConnection(cnString + $";Password={passwordDecryptedSecureString.SecureStringToString()}");
Connection.OpenAsync();

Did someone have the same issue? Or a solution maybe?

Best regards


Solution

  • To get rid of the exceptions, you need to explicitly turn off HA and Load Balancing. Add ;HA EVENTS=false;LOAD BALANCING=false to your connection string.