IIS服务器和Oracle服务器:

1.配置msdtc允许DTC访问及启用事务

2.配置msdtc程序入站出站例外

3.数据库连接字符串不能带enlist=false标识

如下这样带enlist=false标识的,TransactionScope事务无效:

<add name="myDB" connectionString="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1) (PORT=1521)))(CONNECT_DATA=(SERVICE_NAME= Orcl)));enlist=false;User Id=vinson; Password=vinson;Unicode=True;" providerName="System.Data.OracleClient"/>

去掉enlist=false标识,TransactionScope事务才能生效:

<add name="myDB" connectionString="Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1) (PORT=1521)))(CONNECT_DATA=(SERVICE_NAME= Orcl)));User Id=vinson; Password=vinson;Unicode=True;" providerName="System.Data.OracleClient"/>

 

posted on 2019-09-04 16:13  vinsonLu  阅读(388)  评论(0编辑  收藏  举报