我在c#上有一个Web服务,可以与AS400通信。 “随机”出现此错误:
错误[08S01] [IBM] [系统i Access ODBC驱动程序]通信链接失败。通讯rc = 1018-CWB0999-意外错误:意外返回 System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle的代码1018 hrHandle,RetCode retcode)位于 System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection连接, OdbcConnectionString构造函数,OdbcEnvironmentHandle环境句柄) 在 System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions 选项,DbConnectionPoolKey poolKey,对象poolGroupProviderInfo, DbConnectionPool池,DbConnection owneringObject)位于 System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection,DbConnectionPoolGroup,poolGroup,DbConnectionOptions userOptions) System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection,TaskCompletionSource
1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource
1重试,DbConnectionOptions userOptions)位于 System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection externalConnection,DbConnectionFactory connectionFactory)位于 System.Data.Odbc.OdbcConnection.Open()位于 Inaltec.EmisionNS.DALSIIF.CDALMain.ConsultarTarjetasImpresionFD(String p_strCedula) Inaltec.EmisionNS.ReglasNegocio.CTxConsultaTarjetasImpresionFD.ConsultarTarjetasImpresionFD(CTxConsultaEstadoEmisionRequest p_objRequest)
查询完成后,所有连接均关闭,但错误仍然存在。唯一的解决方案是重新启动Web服务。我该怎么办,或者在哪里可以找到此错误根源。这是生成错误的方法:
using (m_objConexion = new OdbcConnection(m_strCadenaConexion))
{
m_objConexion.ConnectionTimeout = 10;
if (System.Configuration.ConfigurationManager.AppSettings["ConnectTimeout"] != null)
m_objConexion.ConnectionTimeout = int.Parse(System.Configuration.ConfigurationManager.AppSettings["ConnectTimeout"].ToString());
m_objConexion.Open();
OdbcCommand l_odbcCommand = null;
OdbcParameter l_odbcParametro = null;
//Business Rules
OdbcDataReader l_odbcDataReader = l_odbcCommand.ExecuteReader();
l_dttRetorno.Load(l_odbcDataReader);
l_odbcDataReader.Close();
}
catch (Exception p_objExcepcion)
{
CDataAccessLayer.ManejarExcepcion(p_objExcepcion, CErrores.ERROR_EJECUTANDO_PROCEDIMIENTO_ALMACENADO, l_strNombreProcedimientoAlmacenado);
}
finally
{
l_odbcCommand.Dispose();
m_objConexion.Close();
m_objConexion = null;
}
我不知道错误代码的确切含义,除了通信失败之外。如果有任何帮助,我将不胜感激。
PS:对不起,我的英语不好