Query query = manager.createQuery("select m from StoredMessageReference m where m.destination=?1 and m.id>?2 order by m.id asc");
query.setParameter(1, destinationName);
query.setParameter(2, ss.getLastAckedId());
for (StoredMessageReference m : (List<StoredMessageReference>)query.getResultList()) {
MessageId mid = new MessageId(m.getMessageId());
mid.setBrokerSequenceId(m.getId());
listener.recoverMessageReference(mid);
}
} catch (Throwable e) {
adapter.rollbackEntityManager(null, manager);
throw IOExceptionSupport.create(e);