[
https://issues.apache.org/jira/browse/AMQ-9541?focusedWorklogId=927419&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-927419
]
ASF GitHub Bot logged work on AMQ-9541:
---------------------------------------
Author: ASF GitHub Bot
Created on: 25/Jul/24 13:47
Start Date: 25/Jul/24 13:47
Worklog Time Spent: 10m
Work Description: jeanouii commented on code in PR #1275:
URL: https://github.com/apache/activemq/pull/1275#discussion_r1691475604
##########
activemq-jdbc-store/src/main/java/org/apache/activemq/store/jdbc/adapter/DefaultJDBCAdapter.java:
##########
@@ -586,12 +584,12 @@ public void doRecoverSubscription(TransactionContext c,
ActiveMQDestination dest
@Override
public void doRecoverNextMessages(TransactionContext c,
ActiveMQDestination destination, String clientId,
- String subscriptionName, long seq, long priority, int maxReturned,
JDBCMessageRecoveryListener listener) throws Exception {
+ String subscriptionName, long seq, long
priority, int maxReturned, JDBCMessageRecoveryListener listener) throws
Exception {
PreparedStatement s = null;
ResultSet rs = null;
try {
- s =
c.getConnection().prepareStatement(this.statements.getFindDurableSubMessagesStatement());
+ s =
c.getConnection().prepareStatement(this.limitQuery(this.statements.getFindDurableSubMessagesStatement()));
s.setMaxRows(Math.min(maxReturned * 2, maxRows));
Review Comment:
I'm not sure why there is "* 2" for the setMaxRows
Issue Time Tracking
-------------------
Worklog Id: (was: 927419)
Time Spent: 0.5h (was: 20m)
> Missing limit on expensive queries.
> -----------------------------------
>
> Key: AMQ-9541
> URL: https://issues.apache.org/jira/browse/AMQ-9541
> Project: ActiveMQ Classic
> Issue Type: Bug
> Affects Versions: 5.18.5, 6.1.2
> Reporter: Jean-Louis Monteiro
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> https://issues.apache.org/jira/browse/AMQ-6049 did add the ability to limit
> the size of the records returned by the database.
>
> Some queries do not apply the limit even though the limit is applied on the
> Java side.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact