if (!msgs.isEmpty())
if (containsReliable && isRecoverable())
   private void pullMessages() throws Throwable   {             RemoteQueueStub theQueue;      int thePullSize;            synchronized (pullLock)      {         if (pullQueue == null)         {            return;         }         theQueue = pullQueue;         thePullSize = pullSize;      }                      Transaction tx = tr.createTransaction();               ClusterRequest req = new PullMessagesRequest(this.nodeId, tx.getId(), theQueue.getChannelID(),                                                   name, thePullSize);            if (trace)      {         log.trace(System.identityHashCode(this) + " Executing pull messages request for queue " + name +                   " pulling from node " + theQueue.getNodeId() + " to node " + this.nodeId);      }            byte[] bytes = (byte[])office.syncSendRequest(req, theQueue.getNodeId(), true);            if (bytes == null)      {         //Ok - node might have left the group         return;      }            PullMessagesResponse response = new PullMessagesResponse();            StreamUtils.fromBytes(response, bytes);      List msgs = response.getMessages();            if (trace) { log.trace(System.identityHashCode(this) + " I retrieved " + msgs.size() + " messages from pull"); }            Iterator iter = msgs.iterator();            while (iter.hasNext())      {         org.jboss.messaging.core.Message msg = (org.jboss.messaging.core.Message)iter.next();                  if (msg.isReliable())         {            //It will already have been persisted on the other node            msg.setPersisted(true);         }                  MessageReference ref = null;                  try         {            ref = ms.reference(msg);                        Delivery delRet = handleInternal(null, ref, tx, true, true);                        if (delRet == null || !delRet.isSelectorAccepted())            {               //This should never happen               throw new IllegalStateException("Aaarrgg queue did not accept reference");            }         }         finally         {            if (ref != null)            {               ref.releaseMemoryReference();            }         }                          //Acknowledge on the remote queue stub         Delivery del = new SimpleDelivery(theQueue, ref);                  del.acknowledge(tx);              }            tx.commit();            //TODO what if commit throws an exception - this means the commit message doesn't hit the       //remote node so the holding transaction stays in the holding area       //Need to catch the exception and throw a check message      //What we need to do is catch any exceptions at the top of the call, i.e. just after the interface      //and send a checkrequest      //This applies to a normal message and messages requests too                  if (!msgs.isEmpty())      {                  req = new PullMessagesRequest(this.nodeId, tx.getId());                  office.asyncSendRequest(req, theQueue.getNodeId());      }         }