2
votes

this question can look like a clone of others, but I can't find a correct answer to this one. This is my scenario: I have a C# software called by webservices that need to write to an oracle database. In my test server no problems, it works like a charm, but, in another equal server it gives to me this error:

Oracle.DataAccess.Client.OracleException at Oracle.DataAccess.Client.OracleException.HandleErrorHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure, Boolean bCheck, Int32 isRecoverable) at Oracle.DataAccess.Client.OracleException.HandleError(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, Object src) at Oracle.DataAccess.Client.OracleConnection.Open()

With no other messages. I thought that it is an error installing oracle client, but, another small application that I wrote to test oracle connection works:

var connectionString = ConfigurationManager.AppSettings["connectionString"];
using (OracleConnection nwindConn = new OracleConnection(connectionString))
{
   nwindConn.Open();
   Console.WriteLine("opened");
}

ConnectionString:

Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=thisdatabase.thisinstance)(PORT=1521))(LOAD_BALANCE=yes)(FAILOVER=on)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=serv)(FAILOVER_MODE=(TYPE=SESSION)(METHOD=BASIC)(RETRIES=180)(DELAY=5))));User ID=myuser;Password=mypsw;

So, the problem, I think is in the application configuration, but why the same works on other server? I tried to edit Project and Solution debug platform Configuration but the problem still exists.. Any suggestions?

2
I suggest to post the connectionstring. Feel free to remove security data.... - Steve
Opening a connection and writing to are different animals. Expand your test project to insert some data and see if you get the same error. - crthompson
@paqogomez: but the error is on connection open, so I need to solve this problem first.. - SamDroid
Are you connecting to the same oracle database instance from different machines or is it two different oracle servers. Using your connection string can you use something like Oracles SQL Plus to connect? - spudgun
@Steve: I added connection string. - SamDroid

2 Answers

1
votes

the problem was the IIS user with application was started, "Application pass-trough". I changed it with my administrator user and it works like a charm. Thank you anyway.

0
votes

in the case of using 11g just go to your oracle folder ( mine C:\oracle) and look for the files Oracle.dataAccess.dll you may find 4 files copy them in the BIN of the application and it will all be fine.