SQL Server 简单插入语句超时

SQL Server simple Insert statement times out(SQL Server 简单插入语句超时)
本文介绍了SQL Server 简单插入语句超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个有 6 列的简单表格.大多数情况下,对它的任何插入语句都可以正常工作,但偶尔我会收到 DB Timeout 异常:超时已过.操作完成之前超时时间已过或服务器没有响应.声明已终止.

I have a simple table with 6 columns. Most of the time any insert statements to it works just fine, but once in a while I'm getting a DB Timeout exception: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. The statement has been terminated.

超时设置为 10 秒.

Timeout is set to 10 seconds.

我应该提到我正在使用 NHibernate 并且该语句在插入本身之后还包含一个select SCOPE_IDENTITY()".

I should mention that I'm using NHibernate and that the statement also include a "select SCOPE_IDENTITY()" right after the insert itself.

我的想法是该表被锁定或其他原因,但当时该表上没有其他语句在运行.

My thought was that the table was locked or something, but there were no other statements running on that table at that time.

所有的插入都很简单,在sql profiler中一切正常,表没有索引,只有PK(页面完整度:98.57 %).

All the inserts are very simple, everything looks normal in sql profiler, the table has no indices but the PK (Page fullness: 98.57 %).

关于我应该寻找什么的任何想法?

Any ideas on what should I look for?

谢谢.

推荐答案

我们的 QA 有一些 Excel 连接返回了大结果集,这些查询在一段时间内被 ASYNC_NETWORK_IO 的 WaitType 暂停.在此期间,所有其他查询均超时,因此与特定插入无关.

Our QA had some Excel connections that returned big result sets, those queries got suspended with WaitType of ASYNC_NETWORK_IO for some time. During this time all other queries timed out, so that specific insert had nothing to do with it.

这篇关于SQL Server 简单插入语句超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Execute complex raw SQL query in EF6(在EF6中执行复杂的原始SQL查询)
Hibernate reactive No Vert.x context active in aws rds(AWS RDS中的休眠反应性非Vert.x上下文处于活动状态)
Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
Flask + PyMySQL giving error no attribute #39;settimeout#39;(FlASK+PyMySQL给出错误,没有属性#39;setTimeout#39;)
auto_increment column for a group of rows?(一组行的AUTO_INCREMENT列?)
Sort by ID DESC(按ID代码排序)