diff --git a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/Statements.java b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/Statements.java index b6797123b9..b61fe16c90 100644 --- a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/Statements.java +++ b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/Statements.java @@ -106,7 +106,7 @@ public class Statements { + ", SUB_DEST " + stringIdDataType + ", CLIENT_ID " + stringIdDataType + " NOT NULL" + ", SUB_NAME " + stringIdDataType + " NOT NULL" + ", SELECTOR " + stringIdDataType + ", LAST_ACKED_ID " + sequenceDataType - + ", PRIMARY KEY ( CONTAINER, CLIENT_ID, SUB_NAME))", + + ", CONSTRAINT PK_" + getDurableSubAcksTableName() + " PRIMARY KEY ( CONTAINER, CLIENT_ID, SUB_NAME))", "ALTER TABLE " + getFullMessageTableName() + " ADD PRIORITY " + sequenceDataType, "CREATE INDEX " + getFullMessageTableName() + "_PIDX ON " + getFullMessageTableName() + " (PRIORITY)", "ALTER TABLE " + getFullMessageTableName() + " ADD XID " + stringIdDataType, diff --git a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/adapter/TransactJDBCAdapter.java b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/adapter/TransactJDBCAdapter.java index 41879792cf..8672846f53 100644 --- a/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/adapter/TransactJDBCAdapter.java +++ b/activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/adapter/TransactJDBCAdapter.java @@ -35,6 +35,7 @@ public class TransactJDBCAdapter extends ImageBasedJDBCAdaptor { } statements.setLockCreateStatement(lockCreateStatement); + statements.setDropAckPKAlterStatementEnd("DROP CONSTRAINT PK_" + statements.getDurableSubAcksTableName()); super.setStatements(statements); }