// Get all the Message ids out of the database.
try {
Connection c = TransactionContext.getConnection();
adapter.doRecover(c, destinationName, new MessageListResultHandler() {
public void onMessage(long seq, String messageID) throws JMSException {
container.recoverMessageToBeDelivered(new MessageIdentity(messageID, new Long(seq)));
}
});
} catch (SQLException e) {
throw JMSExceptionHelper.newJMSException("Failed to recover container. Reason: " + e, e);