Exemplo n.º 1
0
 /// <summary>
 ///  清理所有正在使用的资源
 /// </summary>
 public void Dispose()
 {
     if (isComplete)
     {//事务完成,没有发生任何异常
         if (ada == null)
         {
             DefaultData.CommitTransaction(TransactionID);
         }
         else
         {
             ada.CommitTransaction(TransactionID);
         }
     }
     else
     {//客户端发生异常,导致无法继续,事务回滚
         if (ada == null)
         {
             DefaultData.RollbackTransaction(TransactionID);
         }
         else
         {
             ada.RollbackTransaction(TransactionID);
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 提交事务
 /// </summary>
 /// <param name="TransID">事务ID</param>
 public static void CommitTransaction(string TransID)
 {
     ada.CommitTransaction(TransID);
 }