ConnectionRead (WrapperRead())Timeout expired
■环境说明:
数据库系统:Microsoft Server 2000 (Sp4)
操作系统:Microsoft Server 2003 (SP1)
开发环境:Microsoft Visual Studio .net 2003
■代码
2 try
3 {
4 SqlComm.Connection = sqlConn;
5 SqlComm.CommandText = p_ProcedureName;
6 SqlComm.CommandType=CommandType.StoredProcedure ;
7 SqlComm.ExecuteNonQuery();
8 }
9 catch (SqlException myException)
10 {
11 for (int i=0; i < myException.Errors.Count; i++)
12 {
13 errorMessages = "Index #" + i + "\n" +
14 "Source: " + myException.Errors[i].Source + "\n" +
15 "Number: " + myException.Errors[i].Number.ToString() + "\n" +
16 "State: " + myException.Errors[i].State.ToString() + "\n" +
17 "Class: " + myException.Errors[i].Class.ToString() + "\n" +
18 "Server: " + myException.Errors[i].Server + "\n" +
19 "Message: " + myException.Errors[i].Message + "\n" +
20 "Procedure: " + myException.Errors[i].Procedure + "\n" +
21 "LineNumber: " + myException.Errors[i].LineNumber.ToString();
22 }
23 }
24
■说明
执行存储过程p_ProcedureName的过程中,截取到SqlException异常,以上内容如下:
ERROR: Index #0
Source: .Net SqlClient Data Provider
Number: -2
State: 0
Class: 10
Server: DatabaseServer
Message: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Procedure: ConnectionRead (WrapperRead()).
LineNumber: 0
究竟原因为何,最终未能调查出来。
最后换了另一种处理方式,将存储过程放到job中执行。然后代码中通过执行存储过程sp_start_job来启动作业,间接执行自定义的存储过程。避免发生该异常。
如果有更好的方法解决该问题,还请赐教!先行谢过!
2 SqlParameter[] spParams = {
3 new SqlParameter("@job_name",SqlDbType.NVarChar,128)
4 };
5
6 //作业名称
7 spParams[0].Value = p_ProcedureName;
8
9 SqlCommand objSqlCommand = new SqlCommand();
10 objSqlCommand.Connection=objSqlConnection;
11 objSqlCommand.CommandType=CommandType.StoredProcedure;
12 objSqlCommand.CommandText="sp_start_job";
13 for(int i=0 ;i<spParams.Length;i++)
14 {
15 objSqlCommand.Parameters.Add(spParams[i]);
16 }
17
18 objSqlCommand.ExecuteNonQuery();
转载于:https://www.cnblogs.com/zhangwenbo/archive/2006/04/11/te.html
ConnectionRead (WrapperRead())Timeout expired相关推荐
- 连接池和 Timeout expired异常
转自:博客园宁静.致远:http://www.cnblogs.com/zhangzhu/archive/2013/10/10/3361197.html 异常信息: MySql.Data.MySqlCl ...
- MySql 长时间读数据发生超时的异常 Mysql Reader Exception TimeOut expired
mysql connector: .net var r = cmd.ExecuteReader() r.Reader() // <--长时间不停调用 Timeout expired. Th ...
- oracle之 RA-00054: resource busy and acquire with NOWAIT specified or timeout expired
1. truncate 表报 ORA-00054 ,标明有事务正在操作该表 SQL> truncate table alldm.DM_XQKD_YUJING_D; truncate table ...
- 【Flink】Flink exactly-once 报错 Timeout expired after 60000 milliseconds while awaiting InitProducerId
文章目录 1.概述 2.源码分析 1.概述 flink 开启了exactly-once,设置了transaction.id 然后flink一直不停重启,一直报错 org.apache.kafka.co ...
- 【Kafka】Flink kafka TimeoutException Timeout expired while fetching topic metadata
1.背景 一个服务突然不能工作了,数据有输入但是没有数据,好看数据输入进去就丢了,但是正常情况下,应该是最起码正确和错误都应该输出. 下面开始查看日志 docker exec -it xxxx bas ...
- 连接池和 Timeout expired异常【转】
异常信息: MySql.Data.MySqlClient.MySqlException (0x80004005): error connecting: Timeout expired. The tim ...
- 【Oracle】ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
今天在修改表字段类型时出现错误:ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired,看报错应该是 ...
- [译]连接池和 Timeout expired异常
原文标题:Connection Pooling and the "Timeout expired" exception FAQ 来源:http://blogs.msdn.com/a ...
- pyvisa.errors.VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed
在使用python的pyvisa库函数通过visa指令控制仪器时,出现'pyvisa.errors.VisaIOError: VI_ERROR_TMO (-1073807339): Timeout e ...
最新文章
- 大规模使用 Apache Kafka 的20个最佳实践
- python完全支持面向对象编程_[Python] 类与面向对象编程
- 【Android工具类】Activity管理工具类AppManager
- 方立勋_30天掌握JavaWeb_(Servlet+JSP+JavaBean实现)用户注册和登陆
- Unity C# Job System介绍(二) 安全性系统和NativeContainer
- JavaScript 监听手机端的touch滑动事件(滑动手势)
- 深信服云计算BU专家组组长王佳玮:全融合时代的企业云新架构
- redis 缓存模式
- 7.1 pdo 宝塔面板php_宝塔面板PHP7.2 安装mcrypt扩展
- 自制 Word、Excel 批转 PDF 工具
- 我们教授编程的方式统统不对!
- 学成在线(一)项目介绍
- C++实现二阶行列式的计算
- FlyBanner轮播图 和 XBanner轮播图
- 华为近场通讯nfc在哪里打开_华为手机nfc感应区在手机哪个位置
- Leetcode 14.最长公共前缀(Longest Common Prefix)
- Codeforces Round #777 (Div. 2)(A~C)
- python缺失值与异常值处理_pandas学习(常用数学统计方法总结、读取或保存数据、缺省值和异常值处理)...
- python(2)提取多层嵌套列表里子元素的最大值
- java 图片加密
热门文章
- 奇安信代码卫士帮助微软修复严重漏洞,获官方致谢和奖金
- 重磅|前浪、后浪 一起迎接风口! BCS 2020向全球发起议题征集
- 倾斜摄影测量无人机炸机的八大原因及“炸机”预防措施
- HTML5 从0开始 写连连看 第一集. 背景图 表格绘制
- 带项目的学问,如何带半路项目
- Python3批量转换文本文件编码
- sqlite like通配符使用 -转
- 蓝桥杯 ADV-169 算法提高 士兵排队问题
- java如何将表添加到文本区_java – 在itext中向表中的单元格添加更多文本
- 修改项目图标_北京2022冬奥会和冬残奥会体育图标发布