Пример #1
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 public void Dispose()
 {
     if (RealTransaction != null)
     {
         TransactionLevel = 0;
         RealTransaction.Dispose();
         RealTransaction = null;
     }
 }
Пример #2
0
        /// <summary>
        /// Rollbacks this instance.
        /// </summary>
        public void Rollback()
        {
            if (!IsBegined)
            {
                return;
            }

            RealTransaction.Rollback();
            TransactionLevel = 0;
            RealTransaction.Dispose();
            RealTransaction = null;
        }
Пример #3
0
        /// <summary>
        /// Commits this instance.
        /// </summary>
        /// <returns></returns>
        public bool Commit()
        {
            if (!IsBegined)
            {
                return(true);
            }
            TransactionLevel--;

            if (TransactionLevel > 0)
            {
                return(true);
            }


            RealTransaction.Commit();

            RealTransaction.Dispose();
            RealTransaction = null;

            return(true);
        }