简体   繁体   English

OracleClient,间歇性连接问题:应用程序在OracleConnection.Open()上挂起,没有超时,没有引发异常

[英]OracleClient, intermittent connection issue: app hangs on OracleConnection.Open(), no timeout, no exception thrown

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. 应用程序可以正常工作,并且每次都可以从应该部署它的服务器以外的任何机器上进行连接:/当在服务器上运行时,它设法以20次或类似的尝试连接一次。 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). 我想知道切换到ODP.NET是否可以解决该问题,或者至少可以使其更容易排除故障(我已经读过MS的提供程序不是很稳定)。 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 提供程序:System.Data.OracleClient
  • Lib: instantclient-basiclite-win32-10.2.0.3-20061115 库: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 连接字符串的形式为: 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 连接没有问题的其他应用:使用相同库的QueryExpress,Sql Developer
  • Os: Windows Server 2008 Standard SP 2 操作系统:Windows Server 2008 Standard SP 2

We ended up using ODP.NET because of some buggy issues we were having using WCF transferring data from our service to Oracle. 由于使用WCF将数据从服务传输到Oracle时遇到了一些错误问题,我们最终使用了ODP.NET。 I dont recall the actual issue-think something was not working with a certain data type-but it ended up working out pretty well for us. 我不记得实际的问题-认为某些数据类型无法正常工作-但最终对我们来说效果很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 OracleConnection.Open上的NullreferenceException - NullreferenceException on OracleConnection.Open 如果连接已经打开,可以调用OracleConnection.Open()吗? - Is it okay to call OracleConnection.Open() if the connection is already open? Connection.open无限期挂起,不会抛出任何异常 - Connection.open for hangs indefinitely, no exception is thrown OracleConnection.Open()在ASP.NET中不起作用 - OracleConnection.Open() not working in ASP.NET ODP.Net OracleConnection.Open冷启动很慢 - ODP.Net OracleConnection.Open cold start very slow 尝试连接到Oracle数据库时发生OracleConnection.Open()AccessViolationException - OracleConnection.Open() AccessViolationException when try to connect to oracle database OracleConnection.Open 抛出 ORA-12541 TNS 没有监听器 - OracleConnection.Open is throwing ORA-12541 TNS no listener 为什么将 Oracle DB 从 11g 升级到 19c 后 OracleConnection.Open() 的实例会抛出错误? - Why the Instance of OracleConnection.Open() throws an error after upgrading the Oracle DB from 11g to 19c? 尝试打开连接时为什么会引发异常? - Why is an exception thrown when trying to open a connection? OracleConnection在Open()上引发null异常 - OracleConnection throw null exception upon Open()
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM