问题
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?
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/22352812/oracle-dataaccess-client-oracleexception-at-connection-open