各位,有没有搞过MYSQL+ASP.NET,并且能支持分布式事务(即两个数据库连接的事务)。难道asp.net+mysql就不是最佳组合?

解决方案 »

  1.   

    使用不是很多
    using (TransactionScope scope = new TransactionScope())
                {                scope.Complete();
                }
      

  2.   

    这个不支持分布式事务,会报错,在open多个链接时Multiple simultaneous connections or connections with different connection strings
    inside the same transaction are not currently supported.
    看源代码里,的确是判断了是否存在活动的链接,存在则不会执行第二次open操作。虽然你用了多个mysqlconnection实例