git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@892729 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2009-12-21 08:49:56 +00:00
parent 58e6532c7e
commit 5ffcaf4052
2 changed files with 6 additions and 5 deletions

View File

@ -65,6 +65,7 @@ public class Statements {
private String destinationMessageCountStatement;
private String findNextMessagesStatement;
private boolean useLockCreateWhereClause;
private String findAllMessageIdsStatement;
public String[] getCreateSchemaStatements() {
if (createSchemaStatements == null) {
@ -146,14 +147,14 @@ public class Statements {
return findAllMessagesStatement;
}
public String getFindAllMessageIds() {
public String getFindAllMessageIdsStatement() {
// this needs to be limited maybe need to use getFindLastSequenceIdInMsgsStatement
// and work back for X
if (findAllMessagesStatement == null) {
findAllMessagesStatement = "SELECT ID, MSGID_PROD, MSGID_SEQ FROM " + getFullMessageTableName()
if (findAllMessageIdsStatement == null) {
findAllMessageIdsStatement = "SELECT ID, MSGID_PROD, MSGID_SEQ FROM " + getFullMessageTableName()
+ " WHERE CONTAINER=? ORDER BY ID DESC";
}
return findAllMessagesStatement;
return findAllMessageIdsStatement;
}
public String getFindLastSequenceIdInMsgsStatement() {

View File

@ -332,7 +332,7 @@ public class DefaultJDBCAdapter implements JDBCAdapter {
PreparedStatement s = null;
ResultSet rs = null;
try {
s = c.getConnection().prepareStatement(this.statements.getFindAllMessageIds());
s = c.getConnection().prepareStatement(this.statements.getFindAllMessageIdsStatement());
s.setString(1, destination.getQualifiedName());
// limit the query. just need the the last few messages that could be replayed
// on recovery. send or commit reply lost so it gets replayed.