public void removeMessage(ConnectionContext context, MessageAck ack) throws IOException {
EntityManager manager = adapter.beginEntityManager(context);
try {
Query query = manager.createQuery("delete from StoredMessageReference m where m.id=?1");
query.setParameter(1, ack.getLastMessageId().getBrokerSequenceId());
query.executeUpdate();
} catch (Throwable e) {
adapter.rollbackEntityManager(context, manager);
throw IOExceptionSupport.create(e);
}
adapter.commitEntityManager(context, manager);