public void Begin()
		{
			if (status != MessageQueueTransactionStatus.Initialized)
				throw new InvalidOperationException();
			status = MessageQueueTransactionStatus.Pending;
			throw new NotImplementedException();
		}
        /// <include file='..\..\doc\MessageQueueTransaction.uex' path='docs/doc[@for="MessageQueueTransaction.Begin"]/*' />
        /// <devdoc>
        ///    <para>
        ///       Begins a new Message Queuing internal transaction context.
        ///    </para>
        /// </devdoc>
        public void Begin()
        {
            //Won't allow begining a new transaction after the object has been disposed.
            if (this.disposed)
            {
                throw new ObjectDisposedException(GetType().Name);
            }

            lock (this)
            {
                if (internalTransaction != null)
                {
                    throw new InvalidOperationException(Res.GetString(Res.TransactionStarted));
                }
                else
                {
                    int status = SafeNativeMethods.MQBeginTransaction(out this.internalTransaction);
                    if (MessageQueue.IsFatalError(status))
                    {
                        this.internalTransaction = null;
                        throw new MessageQueueException(status);
                    }

                    this.transactionStatus = MessageQueueTransactionStatus.Pending;
                }
            }
        }
		public void Commit()
		{
			if (status != MessageQueueTransactionStatus.Pending)
				throw new InvalidOperationException();
			status = MessageQueueTransactionStatus.Committed;
			throw new NotImplementedException();
		}
 public void Commit()
 {
     lock (syncObj) {
         model.TxCommit();
         status = MessageQueueTransactionStatus.Committed;
     }
 }
		public void Begin ()
		{
			lock (syncObj) {
				if (status == MessageQueueTransactionStatus.Pending)
					throw new InvalidOperationException ("Transaction already started");
				status = MessageQueueTransactionStatus.Pending;
			}
		}
		public void Abort ()
		{
			lock (syncObj) {
				if (model != null)
					model.TxRollback ();
				status = MessageQueueTransactionStatus.Aborted;
			}
		}
Example #7
0
        /// <include file='doc\MessageQueueTransaction.uex' path='docs/doc[@for="MessageQueueTransaction.AbortInternalTransaction"]/*' />
        /// <internalonly/>                                 
        private void AbortInternalTransaction()
        {
            int status = this.internalTransaction.Abort(0, 0, 0);
            if (MessageQueue.IsFatalError(status))
                throw new MessageQueueException(status);

            this.internalTransaction = null;
            this.transactionStatus = MessageQueueTransactionStatus.Aborted;
        }
 public void Begin()
 {
     if (status != MessageQueueTransactionStatus.Initialized)
     {
         throw new InvalidOperationException();
     }
     status = MessageQueueTransactionStatus.Pending;
     throw new NotImplementedException();
 }
 public void Commit()
 {
     if (status != MessageQueueTransactionStatus.Pending)
     {
         throw new InvalidOperationException();
     }
     status = MessageQueueTransactionStatus.Committed;
     throw new NotImplementedException();
 }
 public void Abort()
 {
     lock (syncObj) {
         if (model != null)
         {
             model.TxRollback();
         }
         status = MessageQueueTransactionStatus.Aborted;
     }
 }
Example #11
0
 public void Abort()
 {
     lock (syncObj) {
         if (isActive)
         {
             Context.Model.TxRollback();
         }
         status = MessageQueueTransactionStatus.Aborted;
     }
 }
 public void Begin()
 {
     lock (syncObj) {
         if (status == MessageQueueTransactionStatus.Pending)
         {
             throw new InvalidOperationException("Transaction already started");
         }
         status = MessageQueueTransactionStatus.Pending;
     }
 }
Example #13
0
        private void AbortInternalTransaction()
        {
            int num = this.internalTransaction.Abort(0, 0, 0);

            if (MessageQueue.IsFatalError(num))
            {
                throw new MessageQueueException(num);
            }
            this.internalTransaction = null;
            this.transactionStatus   = MessageQueueTransactionStatus.Aborted;
        }
Example #14
0
 public void Commit()
 {
     lock (this)
     {
         if (this.internalTransaction == null)
         {
             throw new InvalidOperationException(Res.GetString("TransactionNotStarted"));
         }
         int num = this.internalTransaction.Commit(0, 0, 0);
         if (MessageQueue.IsFatalError(num))
         {
             throw new MessageQueueException(num);
         }
         this.internalTransaction = null;
         this.transactionStatus   = MessageQueueTransactionStatus.Committed;
     }
 }
 public void Commit()
 {
     lock (this)
     {
         if (this.internalTransaction == null)
         {
             throw new InvalidOperationException(Res.GetString("TransactionNotStarted"));
         }
         int num = this.internalTransaction.Commit(0, 0, 0);
         if (MessageQueue.IsFatalError(num))
         {
             throw new MessageQueueException(num);
         }
         this.internalTransaction = null;
         this.transactionStatus = MessageQueueTransactionStatus.Committed;
     }
 }
Example #16
0
 public void Begin()
 {
     if (this.disposed)
     {
         throw new ObjectDisposedException(base.GetType().Name);
     }
     lock (this)
     {
         if (this.internalTransaction != null)
         {
             throw new InvalidOperationException(Res.GetString("TransactionStarted"));
         }
         int num = SafeNativeMethods.MQBeginTransaction(out this.internalTransaction);
         if (MessageQueue.IsFatalError(num))
         {
             this.internalTransaction = null;
             throw new MessageQueueException(num);
         }
         this.transactionStatus = MessageQueueTransactionStatus.Pending;
     }
 }
 public void Begin()
 {
     if (this.disposed)
     {
         throw new ObjectDisposedException(base.GetType().Name);
     }
     lock (this)
     {
         if (this.internalTransaction != null)
         {
             throw new InvalidOperationException(Res.GetString("TransactionStarted"));
         }
         int num = SafeNativeMethods.MQBeginTransaction(out this.internalTransaction);
         if (MessageQueue.IsFatalError(num))
         {
             this.internalTransaction = null;
             throw new MessageQueueException(num);
         }
         this.transactionStatus = MessageQueueTransactionStatus.Pending;
     }
 }
Example #18
0
        /// <include file='doc\MessageQueueTransaction.uex' path='docs/doc[@for="MessageQueueTransaction.Begin"]/*' />
        /// <devdoc>
        ///    <para>
        ///       Begins a new Message Queuing internal transaction context.
        ///    </para>
        /// </devdoc>
        public void Begin()
        {
            //Won't allow begining a new transaction after the object has been disposed.
            if (this.disposed)
                throw new ObjectDisposedException(GetType().Name);

            lock (this)
            {
                if (internalTransaction != null)
                    throw new InvalidOperationException(Res.GetString(Res.TransactionStarted));
                else
                {
                    int status = SafeNativeMethods.MQBeginTransaction(out this.internalTransaction);
                    if (MessageQueue.IsFatalError(status))
                    {
                        this.internalTransaction = null;
                        throw new MessageQueueException(status);
                    }

                    this.transactionStatus = MessageQueueTransactionStatus.Pending;
                }
            }
        }
 /// <include file='..\..\doc\MessageQueueTransaction.uex' path='docs/doc[@for="MessageQueueTransaction.MessageQueueTransaction"]/*' />
 /// <devdoc>
 ///    <para>
 ///       Creates a new Message Queuing internal transaction context.
 ///    </para>
 /// </devdoc>
 public MessageQueueTransaction()
 {
     this.transactionStatus = MessageQueueTransactionStatus.Initialized;
 }
Example #20
0
 /// <include file='doc\MessageQueueTransaction.uex' path='docs/doc[@for="MessageQueueTransaction.MessageQueueTransaction"]/*' />
 /// <devdoc>
 ///    <para>
 ///       Creates a new Message Queuing internal transaction context.
 ///    </para>
 /// </devdoc>                
 public MessageQueueTransaction()
 {
     this.transactionStatus = MessageQueueTransactionStatus.Initialized;
 }
		public void Abort ()
		{
			lock (syncObj) {
				if (isActive)
					Context.Model.TxRollback ();
				status = MessageQueueTransactionStatus.Aborted;
			}
		}
		public void Commit ()
		{
			lock (syncObj) {
				model.TxCommit ();
				status = MessageQueueTransactionStatus.Committed;
			}
		}
Example #23
0
        /// <include file='doc\MessageQueueTransaction.uex' path='docs/doc[@for="MessageQueueTransaction.Commit"]/*' />
        /// <devdoc>
        ///    <para>
        ///       Commits a pending internal transaction.
        ///    </para>
        /// </devdoc>
        public void Commit()
        {
            lock (this)
            {
                if (this.internalTransaction == null)
                    throw new InvalidOperationException(Res.GetString(Res.TransactionNotStarted));
                else
                {
                    int status = this.internalTransaction.Commit(0, 0, 0);
                    if (MessageQueue.IsFatalError(status))
                        throw new MessageQueueException(status);

                    this.internalTransaction = null;
                    this.transactionStatus = MessageQueueTransactionStatus.Committed;
                }
            }
        }