示例#1
0
 /// <summary>
 /// 创建一个 <see cref="Wunion.DataAdapter.Kernel.DbInterop.DBTransactionController"/> 事务控制器实例。
 /// </summary>
 /// <param name="trans">与数据库相关的事务对象。</param>
 /// <param name="transDBA">事务数据访问器(用于执行受事务控制的命令)。</param>
 /// <param name="release">释放事务的函数。</param>
 internal DBTransactionController(IDbTransaction trans, TransactionDbAccess transDBA, ReleaseTransHandler release)
 {
     TransOper    = trans;
     _DBA         = transDBA;
     ReleaseTrans = release;
     _UniqueId    = Guid.NewGuid().ToString();
 }
示例#2
0
 /// <summary>
 /// 释放该对象所占用的所有资源。
 /// </summary>
 /// <param name="disposing"></param>
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (TransOper != null)
         {
             Rollback();
             TransOper.Dispose();
             TransOper = null;
         }
         if (ReleaseTrans != null)
         {
             ReleaseTrans(this);
         }
         _DBA = null;
     }
 }