@Test public void rollback() throws JMSException, RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException, NotSupportedException { transaction.begin(); Connection connection = connectionFactory.createConnection(); Session session = connection.createSession(true, Session.SESSION_TRANSACTED); Queue queue = session.createQueue("testQueue"); MessageProducer producer = session.createProducer(queue); connection.start(); TextMessage message = session.createTextMessage("Hello World!!!"); producer.send(message); producer.close(); session.close(); connection.close(); transaction.rollback(); transaction.begin(); connection = connectionFactory.createConnection(); session = connection.createSession(true, Session.SESSION_TRANSACTED); queue = session.createQueue("testQueue"); MessageConsumer consumer = session.createConsumer(queue); message = (TextMessage) consumer.receiveNoWait(); assertNull(message); consumer.close(); session.close(); connection.close(); transaction.commit(); }
@Override public void close() { if (connectionFactory != null) { wrapper.close(connectionFactory); connectionFactory = null; } }
HornetQ extends TopLevelService { @Override public void close() { if (connectionFactory != null) { wrapper.close(connectionFactory); connectionFactory = null; } } }
HornetQ extends TopLevelService { @Override public void close() { if (connectionFactory != null) { wrapper.close(connectionFactory); connectionFactory = null; } }  }
HornetQ extends TopLevelService { @Override public void close() { if (connectionFactory != null) { wrapper.close(connectionFactory); connectionFactory = null; } }  @Override Module configure(); @Override void close(); }
HornetQ extends TopLevelService { @Override public void close() { if (connectionFactory != null) { wrapper.close(connectionFactory); connectionFactory = null; } }  @Override Module configure(); @Override void close();  }