C#SqlException0x80131904:分布式事务已完成将此会话加入新事务或NULL事务中

问题描述

堆栈器,我的Web应用程序(带有Telerik控件+ C#+ sql数据库的Asp.Net Web窗体)在生产服务器上出现异常distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction。 我在最后添加了异常的堆栈跟踪。

奇怪的是,应用程序没有为发生此异常的某些进程使用事务。而且我们还没有实现任何种类的分布式系统概念。 这是有关托管应用程序的服务器的一些信息-

  1. 同一应用程序的一个以上实例托管在同一服务器上。意味着我们拥有不同的客户端,并且每个客户端都在不同的公共域URL上托管相同的Web应用程序。
  2. Web应用程序及其专用的sql数据库位于同一服务器上。
  3. 所有托管的Web应用程序都使用相同的sql用户ID连接到其数据库
  4. 每个应用程序都在IIS中使用其自己的专用应用程序池。

有人可以帮忙弄清楚为什么我得到这个例外吗? 任何形式的帮助,我们都感激不尽:)

堆栈跟踪:

Message: An error occurred while executing the command deFinition. See the inner exception for details.
Source: EntityFramework

at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDeFinition.ExecuteStoreCommands(EntityCommand entityCommand,CommandBehavior behavior)
at System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context,ObjectParameterCollection parameterValues)
at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func,IDbExecutionStrategy executionStrategy,Boolean startLocalTransaction,Boolean releaseConnectionOnSuccess)
at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__displayClass7.b__5()
at System.Data.Entity.Infrastructure.DbExecutionStrategy.Execute[TResult](Func`1 operation)
at System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Entity.Core.Objects.ObjectQuery`1..GetEnumerator>b__0()
at System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at Docktor2.DataAccess.Caching.InmatesCacheManager.GetInmate(Int32 inmateId)
at Docktor2.InmateMedicationManagement.InmateMedicationManagementControllerWithoutSession.get_CurrentInmate()
at Docktor2.InmateMedicationManagement.Presenters.InmateEncountersPresenter.SetCurrentInmateById(Int32 inmateId)
at Docktor2.InmateMedicationManagement.InmateDashBoard.InmateEncounters.Page_Load(Object sender,EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at Docktor2.MasterPages.EncounterPage`1.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,Boolean includeStagesAfterasyncPoint)

INNEREXCEPTION:
System.Data.sqlClient.sqlException (0x80131904): distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.
at System.Data.sqlClient.sqlConnection.OnError(sqlException exception,Boolean breakConnection,Action`1 wrapCloseInAction)
at System.Data.sqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj,Boolean callerHasConnectionLock,Boolean asyncclose)
at System.Data.sqlClient.TdsParser.TryRun(RunBehavior runBehavior,sqlCommand cmdHandler,sqlDataReader dataStream,BulkcopySimpleResultSet bulkcopyHandler,TdsParserStateObject stateObj,Boolean& dataReady)
at System.Data.sqlClient.sqlDataReader.TryConsumeMetaData()
at System.Data.sqlClient.sqlDataReader.get_MetaData()
at System.Data.sqlClient.sqlCommand.FinishExecuteReader(sqlDataReader ds,RunBehavior runBehavior,String resetoptionsstring,Boolean isInternal,Boolean forDescribeParameterEncryption,Boolean shouldCacheForAlwaysEncrypted)
at System.Data.sqlClient.sqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior,Boolean returnStream,Boolean async,Int32 timeout,Task& task,Boolean asyncWrite,Boolean inRetry,sqlDataReader ds,Boolean describeParameterEncryptionRequest)
at System.Data.sqlClient.sqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,String method,taskcompletionsource`1 completion,Boolean& usedCache,Boolean inRetry)
at System.Data.sqlClient.sqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,String method)
at System.Data.sqlClient.sqlCommand.ExecuteReader(CommandBehavior behavior,String method)
at System.Data.Entity.Infrastructure.Interception.Internaldispatcher`1.dispatch[TTarget,TInterceptionContext,TResult](TTarget target,Func`3 operation,TInterceptionContext interceptionContext,Action`3 executing,Action`3 executed)
at System.Data.Entity.Infrastructure.Interception.DbCommanddispatcher.Reader(DbCommand command,DbCommandInterceptionContext interceptionContext)
at System.Data.Entity.Core.EntityClient.Internal.EntityCommandDeFinition.ExecuteStoreCommands(EntityCommand entityCommand,CommandBehavior behavior)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...