public void DeleteRecursion()
        {
            using (TransactionScope ts = new TransactionScope())
            {
                try
                {
                    DeleteInternal();                    ts.VoteCommit();                }
                catch (Exception pEx)
                {
                    ts.VoteCommit();//回滚事务
                    LogManager.getInstance().getLogger(this.GetType()).Error(pEx);
                    throw new AppException("结点递归删除失败");                }
            }
        }        private void DeleteInternal()
        {
            if (!this.Loaded)
                throw new AppException("尚未出始化");
            List<MenuInfo> list = this.MenuItems;
            foreach (MenuInfo mi in list)
            {
                mi.DeleteInternal();
            }
            this.Delete();
        }

解决方案 »

  1.   

    你的事务没有开始啊,另外  ts.VoteCommit();//回滚事务,这是提交事务,不是回滚事务
      

  2.   

    对,写错了catch (Exception pEx)
                    {
                        ts.VoteRollback();//回滚事务
                        LogManager.getInstance().getLogger(this.GetType()).Error(pEx);
                        throw new AppException("结点递归删除失败");                }[/code]
      

  3.   

    流程应该是这样
    try
    {
      TransactionBegin
      ...
      TransactionCommit
    }
    except
    {
      TransactionRollBack
    }