日期:2014-05-17  浏览次数:21309 次

oralce11g TransactionScope 问题,大神门帮忙看看100分结贴。
oracle11g c#分布式事务TransactionScope 执行第二个连接时报Promote 方法返回一个无效的分布式事务值错误。  使用oralce提供的odp.net 连接不是微软的哦,求大神门帮忙看看。

代码如下:

  
using (TransactionScope scope = new TransactionScope())
            {
                string ConnectionString = "User ID=test;Password=test;Data Source=myx;"; 
                Oracle.DataAccess.Client.OracleConnection connection = new Oracle.DataAccess.Client.OracleConnection(ConnectionString);
                connection.Open();
                Oracle.DataAccess.Client.OracleCommand command = connection.CreateCommand();
                command.CommandText = "insert into CESHI(CS,WEWE) values('111','2222')";
                command.CommandType = CommandType.Text;
                command.ExecuteNonQuery();


                string ConnectionString2 = "User ID=test;Password=test;Data Source=myx;";
                Oracle.DataAccess.Client.OracleConnection connection2 = new Oracle.DataAccess.Client.OracleConnection(ConnectionString2);
                connection2.Open();
                Oracle.DataAccess.Client.OracleCommand command2 = connection2.CreateCommand();
                command2.CommandText = "insert into WRERER(RERER,SDSD) values('1111','2222')";
                command2.CommandType = CommandType.Text;
                command2.ExecuteNonQuery();
                scope.Complete();

            }