/// <summary>
        /// Close the TransactionScope
        /// </summary>
        public void Close()
        {
            if (_closed == false)
            {
                if (_logger.IsDebugEnabled)
                {
                    _logger.Debug("Close TransactionScope");
                }

                if (ContextUtil.IsInTransaction)
                {
                    if (_consistent == true && (this.IsVoteCommit))
                    {
                        ContextUtil.EnableCommit();
                    }
                    else
                    {
                        ContextUtil.DisableCommit();
                    }
                }

                if (0 == --TransactionScopeCount)
                {
                    if (_logger.IsDebugEnabled)
                    {
                        _logger.Debug("Leave in ServiceDomain ");
                    }

                    ServiceDomain.Leave();
                }

                _closed = true;
            }
        }
示例#2
0
 public void Close()
 {
     if (!this._closed)
     {
         if (_logger.IsDebugEnabled)
         {
             _logger.Debug("Close TransactionScope");
         }
         if (ContextUtil.IsInTransaction)
         {
             if (this._consistent && this.IsVoteCommit)
             {
                 ContextUtil.EnableCommit();
             }
             else
             {
                 ContextUtil.DisableCommit();
             }
         }
         if (--this.TransactionScopeCount == 0)
         {
             if (_logger.IsDebugEnabled)
             {
                 _logger.Debug("Leave in ServiceDomain ");
             }
             ServiceDomain.Leave();
         }
         this._closed = true;
     }
 }
 public void Example()
 {
     // Set the consistent bit to true and the done bit to false for the
     // current COM+ context.
     ContextUtil.EnableCommit();
 }