捕获异常的时候 偶尔会碰到这个异常报告

导致原因

//正确代码
using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
{
//xxx();
ts.Complete(); }
DoSomething(); //错误代码
using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
{
//xxx();
ts.Complete();
DoSomething();
}

主要原因是 ts.Complete()这个之后不要写任何代码,或者要么就把你写代码放在ts.Complete() 之前

事务报错 [Exception] 当前 TransactionScope 已完成的更多相关文章

  1. jenkins编辑报错Exception when publishing, exception message的解决办法

    jenkins编辑报错Exception when publishing, exception message的解决办法 查看目标主机的磁盘空间是否占满,清理磁盘空间即可

  2. 记一次实际开发过程中遇到事务报错问题 Transaction synchronization is not active

    一:问题场景 在一次http请求的后台接口中返回结果中出现了这个错误信息“Transaction synchronization is not active”,意思是“事务同步器没有激活”,但是被调用 ...

  3. Selenium Grid 运行报错 Exception thrown in Navigator.Start first time ->Error forwarding the new session Empty pool of VM for setup Capabilities

    Selenium Grid 运行报错 : Exception thrown in Navigator.Start first time ->Error forwarding the new se ...

  4. java使用类数组 报错Exception in thread "main" java.lang.NullPointerException

    源代码如下: Point[] points=new Point[n];//Point是一个类 for(int i=0;i<n;i++) { System.out.print("请输入x ...

  5. 启动startUML的时候报错“"Exception EOleSysError in module StarUML.exe at 000AD559. "

    win7操作系统在安装startuml的时候总是报错 出现了如下错误提示:"Exception EOleSysError in module StarUML.exe at 000AD559. ...

  6. 通过phoenix创建hbase表失败,创建语句卡住,hbase-hmaster报错:exception=org.apache.hadoop.hbase.TableExistsException: SYNC_BUSINESS_INFO_BYDAY_EFFECT

    问题描述: 前几天一个同事来说,通过phoenix创建表失败了,一直报表存在的错误,删除也报错,然后就针对这个问题找下解决方案. 问题分析: 1.通过phoenix创建表,一直卡住不动了.创建语句如下 ...

  7. Spring Boot 启动报错 Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37

    使用命令 java -jar springBoot.jar  启动项目,结果报错如下: Exception at java.lang.String.substring(String.java:) at ...

  8. spring boot 整合kafka 报错 Exception thrown when sending a message with key='null' and payload=JSON to topic proccess_trading_end: TimeoutException: Failed to update metadata after 60000 ms.

    org.springframework.kafka.support.LoggingProducerListener- Exception thrown when sending a message w ...

  9. Idea运行时Scala报错Exception in thread "main" java.lang.NoSuchMethodError:com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V

    一.情况描述 使用idea +scala+spark,运行程序代码如下: package cn.idcast.hello import org.apache.spark.rdd.RDD import ...

随机推荐

  1. windows 64位整数

    #include <iostream> #include <ctime> using namespace std; int main() { cout << cou ...

  2. 微软发布WP SDK8.0 新增语音、应用内支付等原生API

    http://www.csdn.net/article/2012-10-31/2811338-windows-phone-8-sdk 京时间10月30日,微软在旧金山举行新一代手机操作系统Window ...

  3. 【面试题001-补充】C++ MyString类的封装

    [面试题001-补充]C++ MyString类的封装  一,C++ MyString类的封装 String.h: 123456789101112131415161718192021222324252 ...

  4. POJ2406 Power Strings KMP算法

    给你一个串s,如果能找到一个子串a,连接n次变成它,就把这个串称为power string,即a^n=s,求最大的n. 用KMP来想,如果存在的话,那么我每次f[i]的时候退的步数应该是一样多的  譬 ...

  5. POJ 2240 Arbitrage(floyd)

    http://poj.org/problem?id=2240 题意 : 好吧,又是一个换钱的题:套利是利用货币汇率的差异进行的货币转换,例如用1美元购买0.5英镑,1英镑可以购买10法郎,一法郎可以购 ...

  6. 嘿嘿,JAVA里第一次运行单元测试成功,立存

    按书上写的单元测试. 居然一次过,爽!!! package org.smart4j.chapter2.test; import java.util.HashMap; import java.util. ...

  7. wireshark: there are no interfaces on which a capture can be done

    权限问题,简单的直接sudo就行. 更安全的做法是: # chmod 4755 /usr/bin/dumpcap dumpcap的所在目录可用whereis命令查看.

  8. Spring 注入static变量

    一般我们我想注入一个static的变量,如下: @Autowired    private static String str; 不过,这样最终结果为null. 1.使用配置文件的方式注入 priva ...

  9. [Unity菜鸟] FBX模型动画提取

    角色已经人形化(Humanoid)了,那它的动画可以用在其它的模型上了也就是可以共用一套模型动画了,但是你有没有发现那动画是和fbx模型绑在一起的,没关系你可以选中这几个动画文件按Contrl+D就可 ...

  10. JavaWeb项目开发案例精粹-第3章在线考试系统-003Dao层

    1. package com.sanqing.dao; import java.util.List; import com.sanqing.po.Student; public interface S ...