相关疑难解决方法(0)

TransactionScope - 基础提供程序在EnlistTransaction上失败.MSDTC被中止

我们的团队遇到的问题表现为:

基础提供程序在EnlistTransaction上失败; 无法访问已处置的对象.对象名称:'Transaction'.

在此输入图像描述

一旦我们开始使用TransactionScope来处理我们的应用程序的事务,它似乎就出现了.

堆栈跟踪的顶部部分被捕获为:

在System.Data.EntityClient.EntityConnection.EnlistTransaction(事务事务)处于System.Data.Objects.ObjectContext.EnsureConnection(),位于Reconciliation.Models的System.Data.Objects.ObjectContext.ExecuteStoreCommand(String commandText,Object [] parameters).在EntityDbEnvironment.cs中的Reconciliation.Models.Legacy.EntityDbEnvironment.ExecuteOracleSql(String sql)中的BillLines.BillLines.Reconciliation.Interfaces.IBillLineEntities.ExecuteStoreCommand(String,Object []):第41行

同时更新MSDTC日志,我已使用此处说明进行了提取:

pid=7060       ;tid=7908       ;time=04/29/2013-16:38:30.269   ;seq=136        ;eventid=TRANSACTION_BEGUN                        ;tx_guid=60f6390c-7570-488a-97a9-2c3912c4ca3e     ;"TM Identifier='(null)                                            '" ;"transaction has begun, description :'<NULL>'"
pid=7060       ;tid=7908       ;time=04/29/2013-16:38:30.269   ;seq=137        ;eventid=RM_ENLISTED_IN_TRANSACTION               ;tx_guid=60f6390c-7570-488a-97a9-2c3912c4ca3e     ;"TM Identifier='(null)                                            '" ;"resource manager #1002 enlisted as transaction enlistment #1. RM guid = 'defc4277-47a6-4cd9-b092-93a668e2097b'"
pid=7060       ;tid=7908       ;time=04/29/2013-16:38:31.658   ;seq=138        ;eventid=RECEIVED_ABORT_REQUEST_FROM_BEGINNER     ;tx_guid=60f6390c-7570-488a-97a9-2c3912c4ca3e     ;"TM Identifier='(null)                                            '" ;"received request to abort the transaction from beginner"
pid=7060       ;tid=7908       ;time=04/29/2013-16:38:31.658   ;seq=139        ;eventid=TRANSACTION_ABORTING                     ;tx_guid=60f6390c-7570-488a-97a9-2c3912c4ca3e     ;"TM Identifier='(null)                                            '" ;"transaction …
Run Code Online (Sandbox Code Playgroud)

c# msdtc entity-framework transactionscope oracle10g

14
推荐指数
2
解决办法
1万
查看次数

关于交易和msdtc的混淆

关于事务和msdtc如何协同工作,我有一些基本的困惑.

我有一个基本的服务器/客户端winforms应用程序.该应用程序使用transactionscope来封装在sql server上执行的几个sql命令.

当我在服务器上启用msdtc网络访问时,应用似乎工作正常.然后有一天它停止工作,说没有启用网络访问.

现在看来我必须在客户端计算机和服务器上启用msdtc网络访问才能使transactioncope工作.

客户端或服务器msdtc服务是否可以进行事务处理?或者两者兼而有之?

有没有人有关于客户端和服务器或服务器上是否需要msdtc网络访问的指导?

.net msdtc transactions winforms

9
推荐指数
2
解决办法
7295
查看次数

实体框架 - 使用SaveChanges(SaveOptions)替换SaveChanges(bool)的事务

这是使用事务或SaveChanges(false)和AcceptAllChanges()的后续问题

特别关于这一行 context2.SaveChanges(false);

现在不推荐使用SaveChanges(bool).我们应该使用SaveChanges(SaveOptions)代替.

SaveOptions有以下选项:

  • 没有
  • AcceptAllChangesAfterSave
  • DetectChangesBeforeSave

哪些映射到SaveChanges(false)?

entity-framework transactions

8
推荐指数
1
解决办法
3208
查看次数