我有一个应用程序开发框架2.0,NHibernate和Oracle。在Win Server 2003/2008和Win XP中一切运行良好,但我将SO Win XP更改为Win 7并且问题已经开始。我的所有事务都停止工作,只有EnterpriseServicesInteropOption.Full。
的操作我没有任何ideia在Win 7中需要做什么配置,因为Win XP工作。
在一段代码下面,当save de object我收到一个OracleException:
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();
}
答案 0 :(得分:0)
TransactionScope
将打开分布式事务。
分布式事务需要在服务器上运行msdtc!
您可以通过执行以下操作(taken from here)
来检查它是否正在运行您需要检查msdtc服务是否正在运行(默认情况下是这样) 禁用)。打开命令提示符(admin)并运行:net start msdtc。 接下来,您需要配置msdtc以允许网络事务,Start |运行 - > comexp.msc然后挖掘直到你到达分布式 事务协调员,右键单击Local DTC并选择 属性。转到安全选项卡并启用网络事务和XA 交易。