为什么SqlTransaction.Rollback会抛出SqlException(11,-2)(即SQL超时异常)
// System.Data.SqlClient.SqlTransaction
public override void Rollback()
{
if (this.IsYukonPartialZombie)
{
if (Bid.AdvancedOn)
{
Bid.Trace("<sc.SqlTransaction.Rollback|ADV> %d# partial zombie no rollback required\n", this.ObjectID);
}
this._internalTransaction = null;
return;
}
this.ZombieCheck();
SqlStatistics statistics = null;
IntPtr intPtr;
Bid.ScopeEnter(out intPtr, "<sc.SqlTransaction.Rollback|API> %d#", this.ObjectID);
SNIHandle target = null;
RuntimeHelpers.PrepareConstrainedRegions();
try
{
target = SqlInternalConnection.GetBestEffortCleanupTarget(this._connection);
statistics = SqlStatistics.StartTimer(this.Statistics);
this._isFromAPI = true;
this._internalTransaction.Rollback();
}
catch (OutOfMemoryException e)
{
this._connection.Abort(e);
throw;
}
catch (StackOverflowException e2)
{
this._connection.Abort(e2);
throw;
}
catch (ThreadAbortException e3)
{
this._connection.Abort(e3);
SqlInternalConnection.BestEffortCleanup(target);
throw;
}
finally
{
this._isFromAPI = false;
SqlStatistics.StopTimer(statistics);
Bid.ScopeLeave(ref intPtr);
}
}
// System.Data.SqlClient.SqlInternalTransaction
internal void Rollback()
{
IntPtr intPtr;
Bid.ScopeEnter(out intPtr, "<sc.SqlInternalTransaction.Rollback|API> %d#", this.ObjectID);
if (this._innerConnection.IsLockedForBulkCopy)
{
throw SQL.ConnectionLockedForBcpEvent();
}
this._innerConnection.ValidateConnectionForExecute(null);
try
{
this._innerConnection.ExecuteTransaction(SqlInternalConnection.TransactionRequest.IfRollback, null, IsolationLevel.Unspecified, null, false);
this.Zombie();
}
catch (Exception e)
{
if (!ADP.IsCatchableExceptionType(e))
{
throw;
}
this.CheckTransactionLevelAndZombie();
if (!this._disposing)
{
throw;
}
}
finally
{
Bid.ScopeLeave(ref intPtr);
}
}
// System.Data.SqlClient.SqlInternalConnectionTds
internal override void ExecuteTransaction(SqlInternalConnection.TransactionRequest transactionRequest, string name, IsolationLevel iso, SqlInternalTransaction internalTransaction, bool isDelegateControlRequest)
{
if (base.IsConnectionDoomed)
{
if (transactionRequest == SqlInternalConnection.TransactionRequest.Rollback || transactionRequest == SqlInternalConnection.TransactionRequest.IfRollback)
{
return;
}
throw SQL.ConnectionDoomed();
}
else
{
if ((transactionRequest == SqlInternalConnection.TransactionRequest.Commit || transactionRequest == SqlInternalConnection.TransactionRequest.Rollback || transactionRequest == SqlInternalConnection.TransactionRequest.IfRollback) && !this.Parser.MARSOn && this.Parser._physicalStateObj.BcpLock)
{
throw SQL.ConnectionLockedForBcpEvent();
}
string transactionName = (name == null) ? string.Empty : name;
if (!this._parser.IsYukonOrNewer)
{
this.ExecuteTransactionPreYukon(transactionRequest, transactionName, iso, internalTransaction);
return;
}
this.ExecuteTransactionYukon(transactionRequest, transactionName, iso, internalTransaction, isDelegateControlRequest);
return;
}
}
为什么SqlTransaction.Rollback会抛出SqlException(11,-2)(即SQL超时异常)的更多相关文章
- 页面打开 抛出w3wp.exe 中发生未处理异常
页面打开 抛出w3wp.exe 中发生未处理异常
- HttpClient连接池抛出大量ConnectionPoolTimeoutException: Timeout waiting for connection异常排查
转自: http://blog.csdn.net/shootyou/article/details/6615051 今天解决了一个HttpClient的异常,汗啊,一个HttpClient使用稍有不慎 ...
- 1:MUI选择器组件抛出“n.getSelectedItem is not a function”异常的解决办法 2:mui三级联动 3:移动端关闭虚拟键盘
1:如下图 问题:引用了mui的地址选择的三级联动的应用在h5上的组件 百度发现别人思路对 Array 原型链方法扩充时,会抛出这个异常. 修改方法: mui.poppicker.js 第 112 行 ...
- pytest执行用例时从conftest.py抛出ModuleNotFoundError:No module named 'XXX'异常的解决办法
一.问题描述 在项目根目录下执行整个测试用例,直接从conftest.py模块中抛出了ModuleNotFoundError:No module named 'TestDatas'的异常: 二.解决方 ...
- 从constructor中抛出exception后,constructor会返回null吗?
刚才琢磨这个问题主要是在想,如果constructor抛出了exception,那么返回的object是什么一个情况呢?如果我这个object中有一些关键的资源没有初始化,比如说Database co ...
- Java中,异常的处理及抛出
首先我们需要知道什么是异常? 常通常指,你的代码可能在编译时没有错误,可是运行时会出现异常.比如常见的空指针异常.也可能是程序可能出现无法预料的异常,比如你要从一个文件读信息,可这个文件不存在,程序无 ...
- PLSQL_Oracle Exception异常分类、异常抛出、异常处理、异常传播(概念)
2014-06-03 Created By BaoXinjian
- java——异常类、异常捕获、finally、异常抛出、自定义异常
编译错误:由于编写程序不符合程序的语法规定而导致的语法问题. 运行错误:能够顺利的编译通过,但是在程序运行过程中产生的错误. java异常类都是由Throwable类派生而来的,派生出来的两个分支分别 ...
- java的异常抛出throws和throw的简单使用
前提: 当在程序测试时,如果你需要定义一个自己的异常,而非现在已经存在的异常,这个时候你需要用到throws和throw,try-catch只是一个简单的捕获异常的过程. 代码如下: package ...
随机推荐
- Android SDK代理服务器解决国内Android SDK不能更新下载问题
- ie8兼容
最近在做ie8兼容,把遇到的问题整理了一下 1. margin:0 auto; 无法居中 解决方法:1.换成h4的文档类型 <!DOCTYPE html PUBLIC "-//W3C/ ...
- 4.Rabbits and Recurrence Relations
Problem A sequence is an ordered collection of objects (usually numbers), which are allowed to repea ...
- Qt MainWindow结构
(图自:FinderCheng 的 Qt 学习之路(11): MainWindow)
- Android 中 非对称(RSA)加密和对称(AES)加密
在非对称加密中使用的主要算法有:RSA.Elgamal.背包算法.Rabin.D-H.ECC(椭圆曲线加密算法)等. 优点: 非对称加密与对称加密相比,其安全性更好:对称加密的通信双方使用相同的秘钥, ...
- get和post的差异
主要差异: 1.get在地址栏上回显示用户信息,安全性低,post采用加密方式传输不显示,安全性高. 2.get相比post提交方式较快一点,因为post封装了一次消息再发送(加密). 3.get方式 ...
- 用帝国CMS时遇到的问题
今天用帝国CMS时出现了如下提示: Table 'tuanwei.phome_ecms_twnews_index' doesn't exist delete from ***_ecms_t 删除栏目时 ...
- Window.Open详解
文章来源:http://www.cnblogs.com/stswordman/archive/2006/06/02/415853.html 一.window.open()支持环境:JavaScript ...
- [转]PHP Session的一个警告
警告全文如下: PHP Warning: Unknown: Your script possibly relies on a session side-effect which existed unt ...
- Android从零开始--安装
1.下载安装eclipse.adt和Android sdk(以前一直以为Android使用的sdk也是java jdk呢,呵呵) 2.都安装完成后配置eclipse的Android的环境,将Andro ...