3

So I'm trying to connect to an Oracle database using the Oracle.ManagedDataAccess-library, where I'm using the following datasource:

(DESCRIPTION =(SOURCE_ROUTE = YES)
(ADDRESS_LIST=
(ADDRESS = (PROTOCOL = TCP)(Host = PROXY-OracleConnectionManager)(Port = 1111))
(ADDRESS = (PROTOCOL = TCP) (Host = MAIN-DATABASE) (Port = 0000)))
(connect_data= (UR = A)(SERVICE_NAME = SERVICENAME)))

I'm also providing a user id and password.

We don't have any control over the database on our end, but as far as I know, they are using a connection manager as the first address, which should route us to the next address in the list if we are authenticated. This works when using this in Oracle SQL Developer but does not work programatically with Oracle.ManagedDataAccess.

This is how I build and use the connection string:

var connString = new OracleConnectionStringBuilder
            {
                {"User Id", settings.DbUserId},
                {"Password", settings.DbUserPassword},
                {"Data Source", settings.DbDataSource}
            };
OracleConnection conn = new OracleConnection(connectionString.ToString())
conn.Open()

When I run this, I get the following error:

ORA-12537: Network Session: End of file

I suspect that the issue is the ADDRESS_LIST and that the routing doesn't work, but I can't say for sure. Anyone able to provide some insight?

Coss
  • 453
  • 1
  • 4
  • 12
  • I've had better luck in-lining the TNS in the `Data Source` of the `ConnectionString` instead to using a `ConnectionStringBuilder` – ardila Dec 11 '15 at 09:14
  • Do you have an example? When I did `..SERVICENAME)));User ID=ID;Password=Pass;` it didn't verify the password. – Coss Dec 11 '15 at 09:22
  • 1
    not sure what you mean by "verify the password". You can try something along the lines of `Provider=(Your provider of choice);Data Source=(In-line TNS);User Id=yourUser;Password=pass;Persist Security Info=True;"` – ardila Dec 11 '15 at 09:37
  • Getting the same error, but thanks anyway! – Coss Dec 11 '15 at 09:51
  • Have you checked http://stackoverflow.com/questions/29847444/odp-net-oracle-manageddataaccess-causes-ora-12537-network-session-end-of-file ? – ardila Dec 11 '15 at 09:54
  • Yeah, it didn't solve my problem unfortunately – Coss Dec 11 '15 at 09:58

0 Answers0