简体   繁体   English

EnterpriseServicesInteropOption,NHibernate和Win7的问题

[英]Problems with EnterpriseServicesInteropOption, NHibernate and Win7

i have an application development framework 2.0, NHibernate and Oracle. 我有一个应用程序开发框架2.0,NHibernate和Oracle。 Everything works well in Win Server 2003/2008 and Win XP, but I changed my SO Win XP to Win 7 and the problems started. 在Win Server 2003/2008和Win XP中一切正常,但是我将SO Win XP更改为Win 7,问题开始出现。 All my transactions stopped working, only operations with EnterpriseServicesInteropOption.Full. 我所有的事务都停止了工作,仅使用EnterpriseServicesInteropOption.Full进行操作。

I don't have any ideia what config I need to do in Win 7, because with Win XP worked. 我没有任何想法在Win 7中需要做哪些配置,因为Win XP可以工作。

below a stretch of code, when save de object I receive an OracleException: 在一段代码下面,当保存对象时,我收到一个OracleException:

Oracle.DataAccess.Client.OracleException Unable to enlist in a distributed transaction Oracle.DataAccess.Client.OracleException无法注册分布式事务

TransactionOptions options = new TransactionOptions();
options.Timeout = new TimeSpan(0, 5, 0);
options.IsolationLevel = IsolationLevel.ReadCommitted;
using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options, EnterpriseServicesInteropOption.Full))
{                       
       // Problems here
   classDao.Save(class);

   scope.Complete();
}

TransactionScope will open a distributed transaction if needed. 如果需要, TransactionScope将打开一个分布式事务。

Distributed transactions require msdtc to be running on the server! 分布式事务需要msdtc在服务器上运行!

You can check if it is running by doing the following ( taken from here ) 您可以通过执行以下操作( 从此处获取 )来检查其是否正在运行

You need to check if msdtc service is running (by default it's disabled). 您需要检查msdtc服务是否正在运行(默认情况下已禁用)。 Open a command prompt (admin) and run: net start msdtc. 打开命令提示符(admin)并运行:net start msdtc。 Next you need to configure msdtc to allow network transactions, Start | 接下来,您需要配置msdtc以允许网络事务, Run -> comexp.msc Then dig down until you get to Distributed Transaction Coordinator, right click on Local DTC and select properties. 运行-> comexp.msc然后向下挖掘,直到到达Distributed Transaction Coordinator,右键单击Local DTC并选择属性。 Go to security tab and enable network transactions and XA transactions. 转到“安全性”选项卡,然后启用网络事务和XA事务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM