mirror of https://github.com/apache/activemq.git
https://issues.apache.org/activemq/browse/AMQ-2473 - fix find all message ids statement
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@892729 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
58e6532c7e
commit
5ffcaf4052
|
@ -65,6 +65,7 @@ public class Statements {
|
||||||
private String destinationMessageCountStatement;
|
private String destinationMessageCountStatement;
|
||||||
private String findNextMessagesStatement;
|
private String findNextMessagesStatement;
|
||||||
private boolean useLockCreateWhereClause;
|
private boolean useLockCreateWhereClause;
|
||||||
|
private String findAllMessageIdsStatement;
|
||||||
|
|
||||||
public String[] getCreateSchemaStatements() {
|
public String[] getCreateSchemaStatements() {
|
||||||
if (createSchemaStatements == null) {
|
if (createSchemaStatements == null) {
|
||||||
|
@ -146,14 +147,14 @@ public class Statements {
|
||||||
return findAllMessagesStatement;
|
return findAllMessagesStatement;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFindAllMessageIds() {
|
public String getFindAllMessageIdsStatement() {
|
||||||
// this needs to be limited maybe need to use getFindLastSequenceIdInMsgsStatement
|
// this needs to be limited maybe need to use getFindLastSequenceIdInMsgsStatement
|
||||||
// and work back for X
|
// and work back for X
|
||||||
if (findAllMessagesStatement == null) {
|
if (findAllMessageIdsStatement == null) {
|
||||||
findAllMessagesStatement = "SELECT ID, MSGID_PROD, MSGID_SEQ FROM " + getFullMessageTableName()
|
findAllMessageIdsStatement = "SELECT ID, MSGID_PROD, MSGID_SEQ FROM " + getFullMessageTableName()
|
||||||
+ " WHERE CONTAINER=? ORDER BY ID DESC";
|
+ " WHERE CONTAINER=? ORDER BY ID DESC";
|
||||||
}
|
}
|
||||||
return findAllMessagesStatement;
|
return findAllMessageIdsStatement;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFindLastSequenceIdInMsgsStatement() {
|
public String getFindLastSequenceIdInMsgsStatement() {
|
||||||
|
|
|
@ -332,7 +332,7 @@ public class DefaultJDBCAdapter implements JDBCAdapter {
|
||||||
PreparedStatement s = null;
|
PreparedStatement s = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try {
|
try {
|
||||||
s = c.getConnection().prepareStatement(this.statements.getFindAllMessageIds());
|
s = c.getConnection().prepareStatement(this.statements.getFindAllMessageIdsStatement());
|
||||||
s.setString(1, destination.getQualifiedName());
|
s.setString(1, destination.getQualifiedName());
|
||||||
// limit the query. just need the the last few messages that could be replayed
|
// 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.
|
// on recovery. send or commit reply lost so it gets replayed.
|
||||||
|
|
Loading…
Reference in New Issue