Exemple #1
0
 /// <summary>
 /// 回滚事务
 /// </summary>
 public void Rollback()
 {
     current = null;
     if (this.db != null && !this.db.IsDisposed)
     {
         this.db.Rollback();
         this.db = null;
     }
 }
Exemple #2
0
 /// <summary>
 /// 提交事务
 /// </summary>
 public void Commit()
 {
     current = null;
     if (this.db != null && !this.db.IsDisposed)
     {
         this.db.Commit();
         this.db = null;
     }
 }
Exemple #3
0
 /// <summary>
 /// 回滚事务
 /// </summary>
 public void Rollback()
 {
     AfxTransaction.ClearCurrent();
     if (null != this.transaction)
     {
         this.transaction.Rollback();
         this.transaction.Dispose();
         this.transaction = null;
         this.OnLog("-- Rollback");
         this.Close();
     }
 }
Exemple #4
0
 /// <summary>
 /// 提交事务
 /// </summary>
 public void Commit()
 {
     if (null == this.transaction)
     {
         throw new InvalidOperationException("未开启事务,不能提交!");
     }
     AfxTransaction.ClearCurrent();
     this.transaction.Commit();
     this.transaction.Dispose();
     this.transaction = null;
     this.OnLog("-- Commit");
     this.Close();
 }
Exemple #5
0
 internal void Clear()
 {
     current = null;
     this.db = null;
 }
Exemple #6
0
 internal AfxTransaction(Database db)
 {
     this.db = db;
     current = this;
 }