Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem Testing TNSNAMES.ora Connection with Oracle.ManagedDataAccess.dll

superfreak3-JavaNetFeb 22 2017 — edited Feb 24 2017

Hi all,

My first post and I'm basically an Oracle newb.  I have a Web App installation that handles both SQL and Oracle Db connections.  During the install we check the entered for successful connection to the database using a little widget with a Oracle.ManagedDataAccess.dll.

Initially everything was working great with what I'll call a direct connection or using this command line to open the connection...

connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=mymachinename.mydom.local)(PORT=1521))(CONNECT_DATA=(SID=ORCL)));User Id=ITSME;Password=Password1;"

Working only with this connection, everything worked installing on both a separate server and pointing to the remote Db or installing directly on the Oracle Db Server.  However, we're recently learned that we have to support TNSNAMES.ora.  So, if this option is chosen, the widget cobbles a connection string as follows...

connectionString="Data Source=ORCL;User Id=ITSME;Password=Password1;"

This is where the weirdness comes in.  To use TNSNAMES.ora our app has to be installed directly on the Oracle Db Server.  For some reason, I cannot get this connection check to function properly.  It just does not connect and returns...

ORA-12154:TNS:could not resolve the connect identifier specified

I read a bunch and played around and eventually got it to work on one of our test servers after compiling my widget as x64.  I thought I had reached the promised land, but there of course was a twist.  Apparently our application is having an issue running directly on the Oracle Db Server as well.  On the server I tested on, Oracle's ManagedDataAccess assembly was removed from the GAC on a test server so the .dll we ship with in the app would work.  Once there was something in the GAC again, my connection check widget success well, failed!

So, I'm wondering how to best handle this as it seems there is some type of conflict with the ManagedDataAccess .dll Oracle installs to the GAC and what we are using in my widget and our app.  This seems like it could be quite hairy.

Just to be clear, if I use the direct connection method as described above on the same machine where TNSNAMES is failing, the direct connection is OK.  Why does TNSNAMES fail.  I've read much information about the message displayed, but everything concerning TNSNAMES.ora seems to be in place.

Any help or information or points to it would be more than GREATLY appreciated!  Please ask questions if you need any more detail!!  Thanks in advance.

This post has been answered by AndrewSayer on Feb 23 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 23 2017
Added on Feb 22 2017
20 comments
4,273 views