MessageConsumer cons = sessReceive.createConsumer(queue);
MessageConsumer cons = sessReceive.createConsumer(queue2);
   public void testSendAndReceivePersistentDifferentConnections() throws Exception   {      Connection connSend = null;      Connection connReceive = null;            try      {                  log.trace("Running testSendAndReceivePersistentDifferentConnections");                  connSend = cf.createConnection();                  connSend.start();                  Session sessSend = connSend.createSession(true, Session.AUTO_ACKNOWLEDGE);                  MessageProducer prod = sessSend.createProducer(null);                  prod.setDeliveryMode(DeliveryMode.PERSISTENT);                  Message m = sessSend.createTextMessage("hello");                  prod.send(queue, m);                  sessSend.commit();                  connReceive = cf.createConnection();                  connReceive.start();                  Session sessReceive = connReceive.createSession(true, Session.SESSION_TRANSACTED);                  MessageConsumer cons = sessReceive.createConsumer(queue);                  TextMessage m2 = (TextMessage)cons.receive(5000);                  assertNotNull(m2);                  assertEquals("hello", m2.getText());                  cons.close();                  sessReceive.commit();                  connReceive = cf.createConnection();                  connReceive.start();                  sessReceive = connReceive.createSession(true, Session.SESSION_TRANSACTED);                  cons = sessReceive.createConsumer(queue);                  TextMessage m3 = (TextMessage)cons.receive(5000);                  assertNull(m3);                           log.trace("Done test");        }      finally      {         if (connSend != null) connSend.close();         if (connReceive != null) connReceive.close();      }   }