Application works fine and connects every single time from any machine except the server, where it's supposed to be deployed :/ When run on the server it manages to connect once in like 20 or something attempts. Judging on the funky symptoms, I suspect it to be some kind of a network configuration related issue (as in some randomly lost packets?), but my fellow network administrator tried many different settings and we were not able to find the cause/solution.
Every single piece of advise will be appreciated, as it's seriously driving me nuts. I was wondering if switching to ODP.NET would solve the problem or at least make it easier to troubleshoot (I've read MS's provider is not very stable). However, since the architecture is not very flexible, it would take quite a lot of time to switch. But if it's the only reasonable thing to do...
Piece of code I'm using:
DbConnection conn = new OracleConnection();
conn.ConnectionString = _connectionString;
try
{
conn.Open();
DbCommand cmd = conn.CreateCommand();
cmd.CommandText = "select sysdate from dual";
cmd.Connection = conn;
_logger.Info("Sysdate: " + cmd.ExecuteScalar().ToString());
}
catch (OracleException oex)
{
_logger.ErrorException("Oracle exception: " + oex.Message, oex);
}
catch (Exception ex)
{
_logger.ErrorException("Exception: " + ex.Message, ex);
}
finally
{
if (conn != null) conn.Close();
}
More info:
- Provider: System.Data.OracleClient
- Lib: instantclient-basiclite-win32-10.2.0.3-20061115
- Connection string is of the form:
Data Source=ip_address:port_number/instance;Persist Security Info=True;User ID=user;Password=passwd
- Other apps which connect without a problem: QueryExpress using same libs, Sql Developer
- Os: Windows Server 2008 Standard SP 2