示例#1
0
        public void Rollback()
        {
            _count--;
            if (_count == 0)
            {
                Transaction.Rollback();

                DbTransactionContext.RemoveTransaction(DataBase);

                if (!DbTransactionContext.HasTransaction(DataBase) && Connection != null)
                {
                    CloseConnection(Connection);
                }
            }
        }
示例#2
0
        public void Commit()
        {
            _count--;

            if (_count == 0)
            {
                Transaction.Commit();

                DbTransactionContext.RemoveTransaction(DataBase);

                if (!DbTransactionContext.HasTransaction(DataBase) && Connection != null)
                {
                    Connection.Close();
                }
            }
        }