/// <summary>
        /// Does the recieve and execute using message queue transaction manager.
        /// </summary>
        /// <param name="mq">The message queue.</param>
        /// <param name="status">The transactional status.</param>
        /// <returns>true if should continue peeking, false otherise</returns>
        protected virtual bool DoRecieveAndExecuteUsingMessageQueueTransactionManager(MessageQueue mq,
                                                                                      ITransactionStatus status)
        {
            #region Logging

            if (LOG.IsDebugEnabled)
            {
                LOG.Debug("Executing DoRecieveAndExecuteUsingMessageQueueTransactionManager");
            }

            #endregion Logging

            Message message;

            #region Receive message

            try
            {
                message = mq.Receive(TimeSpan.Zero, QueueUtils.GetMessageQueueTransaction(null));
            }
            catch (MessageQueueException ex)
            {
                if (ex.MessageQueueErrorCode == MessageQueueErrorCode.IOTimeout)
                {
                    //expected to occur occasionally
                    if (LOG.IsTraceEnabled)
                    {
                        LOG.Trace("IOTimeout: Message to receive was already processed by another thread.");
                    }
                    status.SetRollbackOnly();
                    return(false); // no more peeking unless this is the last listener thread
                }
                else
                {
                    // A real issue in receiving the message

                    #region Logging

                    if (LOG.IsErrorEnabled)
                    {
                        LOG.Error("Error receiving message from DefaultMessageQueue [" + mq.Path +
                                  "], closing queue and clearing connection cache.");
                    }

                    #endregion

                    lock (messageQueueMonitor)
                    {
                        mq.Close();
                        MessageQueue.ClearConnectionCache();
                    }
                    throw; // will cause rollback in MessageQueueTransactionManager and log exception
                }
            }

            #endregion

            if (message == null)
            {
                #region Logging

                if (LOG.IsTraceEnabled)
                {
                    LOG.Trace("Message recieved is null from Queue = [" + mq.Path + "]");
                }

                #endregion

                status.SetRollbackOnly();
                return(false); // no more peeking unless this is the last listener thread
            }

            try
            {
                #region Logging

                if (LOG.IsDebugEnabled)
                {
                    LOG.Debug("Received message [" + message.Id + "] on queue [" + mq.Path + "]");
                }

                #endregion

                MessageReceived(message);
                DoExecuteListener(message);

                #region Logging

                if (LOG.IsTraceEnabled)
                {
                    LOG.Trace("MessageListener executed");
                }

                #endregion
            }
            catch (Exception ex)
            {
                //Exception may indicate rollback of database transaction in service layer.
                //Let the handler determine if the message should be removed from the queue.
                TransactionAction action =
                    HandleTransactionalListenerException(ex, message, QueueUtils.GetMessageQueueTransaction(null));
                if (action == TransactionAction.Rollback)
                {
                    #region Logging

                    if (LOG.IsDebugEnabled)
                    {
                        LOG.Debug(
                            "Exception handler's TransactionAction has rolled back MessageQueueTransaction for queue [" +
                            mq.Path + "]");
                    }

                    #endregion

                    status.SetRollbackOnly();
                    return(false); // no more peeking unless this is the last listener thread
                }
                else
                {
                    LOG.Info("Committing MessageQueueTransaction due to explicit commit request by exception handler.");
                }
            }
            finally
            {
                message.Dispose();
            }
            return(true);
        }