adapter.addDurableConsumer(connection, destination.getName(), name);
}
while (iterator.hasNext()) {
MessageState state = (MessageState) iterator.next();
MessageImpl message = adapter.getMessage(connection,
state.getMessageId());
PersistentMessageHandle handle =
new PersistentMessageHandle(message.getJMSMessageID(),
message.getJMSPriority(),
message.getAcceptedTime(),
message.getSequenceNumber(),
message.getJMSExpiration(),
destination,
name);
handle.setDelivered(state.getDelivered());
handle.add();
}
_database.commit();
}