last piece of https://issues.apache.org/activemq/browse/AMQ-2540 - fix order or audit recovery replay

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@893661 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2009-12-24 00:38:28 +00:00
parent 6cde61831e
commit 5fb52355d6
2 changed files with 8 additions and 2 deletions

View File

@ -519,7 +519,7 @@ public class JDBCPersistenceAdapter extends DataSourceSupport implements Persist
e = e.getNextException(); e = e.getNextException();
s += ", due to: " + e.getMessage(); s += ", due to: " + e.getMessage();
} }
LOG.debug(s, e); LOG.warn(s, e);
} }
public Statements getStatements() { public Statements getStatements() {

View File

@ -25,6 +25,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.TreeSet; import java.util.TreeSet;
@ -335,8 +336,13 @@ public class DefaultJDBCAdapter implements JDBCAdapter {
s = c.getConnection().prepareStatement(this.statements.getFindAllMessageIdsStatement()); s = c.getConnection().prepareStatement(this.statements.getFindAllMessageIdsStatement());
s.setMaxRows(limit); s.setMaxRows(limit);
rs = s.executeQuery(); rs = s.executeQuery();
// jdbc scrollable cursor requires jdbc ver > 1.0 andis often implemented locally so avoid
LinkedList<MessageId> reverseOrderIds = new LinkedList<MessageId>();
while (rs.next()) { while (rs.next()) {
listener.messageId(new MessageId(rs.getString(2), rs.getLong(3))); reverseOrderIds.addFirst(new MessageId(rs.getString(2), rs.getLong(3)));
}
for (MessageId id : reverseOrderIds) {
listener.messageId(id);
} }
} finally { } finally {
close(rs); close(rs);