具体报错

The requested operation cannot be completed because the connection has been broken. -- xxxForyyy->Index at System.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransaction(TransactionRequest transactionRequest, String name, IsolationLevel iso, SqlInternalTransaction internalTransaction, Boolean isDelegateControlRequest)
at System.Data.SqlClient.SqlDelegatedTransaction.Initialize()
at System.Transactions.TransactionStatePSPEOperation.PSPEInitialize(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Guid promoterType)
at System.Transactions.TransactionStateActive.EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction, Guid promoterType)
at System.Transactions.Transaction.EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Guid promoterType)
at System.Transactions.Transaction.EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification promotableSinglePhaseNotification)
at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)
at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)
at System.Data.SqlClient.SqlInternalConnection.EnlistTransaction(Transaction transaction)
at System.Data.SqlClient.SqlConnection.EnlistTransaction(Transaction transaction)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<EnlistTransaction>b__30(DbConnection t, EnlistTransactionInterceptionContext c)
at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action`2 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.EnlistTransaction(DbConnection connection, EnlistTransactionInterceptionContext interceptionContext)
at System.Data.Entity.Core.EntityClient.EntityConnection.EnlistTransaction(Transaction transaction)

错误:正在创建模型,此时不可使用上下文。如果在 OnModelCreating 方法内使用上下文或如果多个线程同时访问同一上下文实例,可能引发此异常。请注意不保证 DbContext 的实例成员和相关类是线程安全的。

-------------------------

原因可能是并发多线程调用DbContext问题,可以将报错点(Action,AttributeFilter)中的 DbContext 调用换成原生的SqlConnection 试下。

The requested operation cannot be completed because the connection has been broken的更多相关文章

  1. The requested operation has failed apache

    在安装apache后, 启动apache时提示The requested operation has failed错误: 通过一排除 cd apache 安装的Bin目录cmd如下秘密(双引号中的内容 ...

  2. Apache启动是出现the requested operation has failed

    出现的原因: 原因一:80端口占用例如IIS,另外就是迅雷. 原因二:软件冲突装了某些软件会使apache无法启动如Dr.com 你打开网络连接->TcpIp属性->高级->WINS ...

  3. apache启动报错:the requested operation has failed解决办法

    原因一:80端口占用 例如IIS,另外就是迅雷.我的apache服务器就是被迅雷害得无法启用! 原因二:软件冲突 装了某些软件会使apache无法启动如Dr.com 你打开网络连接->TcpIp ...

  4. Apache无法启动解决 the requested operation has failed

    Apache不能启动解决办法 原因一:80端口占用例如IIS,另外就是迅雷. 原因二:软件冲突装了某些软件会使apache无法启动如Dr.com 你打开网络连接->TcpIp属性->高级- ...

  5. Apache无法启动提示the requested operation has failed

    主要参考这篇 http://apps.hi.baidu.com/share/detail/15868128 但还是遇到一些问题,记录如下: 1. 配置完成后,restart apache,出现 the ...

  6. kali kvm Requested operation is not valid: network 'default' is not active

    安装时候参考的:http://www.ilanni.com/?p=6101 今天安装完kvm,满是幸福的装了个xp,重启后出现了一个错误 Requested operation is not vali ...

  7. (windows下的)Apache无法启动解决 the requested operation has failed

     以下文章是转载别人的,这里只做学习用 ============================================================================== ...

  8. The server has either erred or is incapable of performing the requested operation. (HTTP 500)

    感谢朋友支持本博客,欢迎共同探讨交流,因为能力和时间有限,错误之处在所难免,欢迎指正. 假设转载.请保留作者信息. 博客地址:http://blog.csdn.net/qq_21398167 原博文地 ...

  9. Win7共享问题 映射网盘时出现的错误 the specified server cannot perform the requested operation

    Win7共享问题 映射网盘时出现的错误:the specified server cannot perform the requested operation 解决方案: 1.重启电脑: 2.修改注册 ...

  10. ApacheHttpServer出现启动报错:the requested operation has failed解决办法

    转自:https://www.jb51.net/article/21004.htm 原因一:80端口占用 例如IIS,另外就是迅雷.我的apache服务器就是被迅雷害得无法启用! 原因二:软件冲突 装 ...

随机推荐

  1. 牛客网-SQL专项训练25

    ①批处理是指包含一条或多条T-SQL语句的语句组,下列选项中,关于批处理的规则描述正确的是(B) 解析: A选项:不能定义一个check约束后,立即在同一个批处理中使用: C选项:Create def ...

  2. 一个 Blink 小白的成长之路

    写在前面 写过blink sql的同学应该都有体会,明明写的时候就很顺滑,小手一抖,洋洋洒洒三百行代码,一气呵成.结果跑的时候,吞吐量就是上不去.导致数据延迟高,消息严重积压,被业务方疯狂吐槽.这时候 ...

  3. 阿里巴巴超大规模Kubernetes基础设施运维体系揭秘

    ​简介:ASI:Alibaba Serverless infrastructure,阿里巴巴针对云原生应用设计的统一基础设施.ASI 基于阿里云公共云容器服务 ACK之上,支撑集团应用云原生化和云产品 ...

  4. dotnet 警惕 C# 的 is var 写法

    本文将和大家介绍 C# 语言设计里面,我认为比较坑的一个语法.通过 is var 的写法,会让开发者误以为 null 是不被包含的,然而事实是在这里的 var 是被赋予含义的,将被允许 null 通过 ...

  5. three.js实现相机碰撞,相机不穿墙壁、物体

    大家好,本文实现了相机碰撞检测,使相机不穿墙壁.物体,并给出了思路和代码,感谢大家~ 关键词:数字孪生.three.js.Web3D.WebGL.相机碰撞.游戏相机 我正在承接Web3D数字孪生项目, ...

  6. 痞子衡嵌入式:恩智浦i.MX RT1xxx系列MCU启动那些事(12.A)- uSDHC eMMC启动时间(RT1170)

    大家好,我是痞子衡,是正经搞技术的痞子.今天痞子衡给大家介绍的是恩智浦i.MX RT1170 uSDHC eMMC启动时间. 本篇是 i.MXRT1170 启动时间评测第五弹,前四篇分别给大家评测了 ...

  7. AIRIOT答疑第3期|如何使用物联网平台的可视化组态引擎?

    丰富组件,满足千人千面! AIRIOT物联网低代码平台的可视化组态引擎,具备丰富的可视化看板及组件,满足各类工艺流程图.数据可视化需求.支持三维编辑.图形绘制.图表设计等设计方式,PPT模式设计软件界 ...

  8. vulnhub --> Web Machine: (N7)

    靶场下载地址 Web Machine: (N7) << 点我 开始打靶 ip发现: nmap扫描网段发现靶机ip:192.168.56.101 端口发现: 对靶机进行常规端口扫描 访问网站 ...

  9. Spring 对于事务上的应用的详细说明

    1. Spring 对于事务上的应用的详细说明 @ 目录 1. Spring 对于事务上的应用的详细说明 每博一文案 2. 事务概述 3. 引入事务场景 3.1 第一步:准备数据库表 3.2 第二步: ...

  10. VAE-可变自动编码器

    VAE 有什么作用? 简而言之,它改进了生成的图像.VAE 针对图像的某些方面进行训练,并且我们的 UI ( vae-ft-mse-840000-ema-pruned) 中捆绑的默认 VAE 改善了生 ...