milamberspace commented on code in PR #6861:
URL: https://github.com/apache/jmeter/pull/6861#discussion_r4727143276
##########
xdocs/changes.xml:
##########
@@ -163,6 +163,11 @@ Summary
<li><pr>6742</pr>Keep the HTTP clients of a thread from being used, and
closed, by another thread when embedded resources are downloaded in parallel.
The threads which perform those downloads are pooled and shared by all threads,
so they used to keep the clients of whichever thread happened to create them,
which made samples fail with errors such as <code>Non HTTP response code:
java.io.IOException</code>, <code>Socket closed</code> or <code>Connection pool
shut down</code> as soon as that thread finished or started a new iteration.
The clients are now looked up by the context of the thread the download is
performed for, in the HttpClient4 and HttpClient5 sampler implementations.</li>
</ul>
+ <h3>JDBC Sampler</h3>
+ <ul>
+ <li><issue>6345</issue>Separate the JDBC statement's maximum row limit
from the client-side <code>Limit ResultSet</code> option, so users can limit
rows read by JMeter without allowing the JDBC driver or database to optimize
away query work.</li>
Review Comment:
Could you also add an entry under *Incompatible changes*? Plans created with
5.6.3 that rely on `Limit ResultSet` to call `setMaxRows()` will now run the
full query. Something like:
```xml
<li><issue>6345</issue>JDBC elements: <code>Limit ResultSet</code> no longer
calls <code>Statement.setMaxRows()</code> (behavior introduced in 5.6.3); it
only limits the rows read by JMeter. Use the new <code>Max Rows</code> field to
limit the rows on the JDBC statement.</li>
```
##########
src/protocol/jdbc/src/main/java/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java:
##########
@@ -241,9 +242,9 @@ protected byte[] execute(Connection conn, SampleResult
sample) throws SQLExcepti
}
private void configureMaxRows(Statement stmt) throws SQLException {
- int maxRows = getIntegerResultSetMaxRows();
+ int maxRows = getIntegerMaxRows();
Review Comment:
Pre-existing and not blocking for this PR: for callable statements and
prepared updates, `configureMaxRows` is called from `resultSetsToString`, i.e.
after `execute()` / `executeUpdate()`, so `setMaxRows` has no effect there.
Since the new `Max Rows` documentation says it applies to the JDBC statement,
it might be worth either moving the call before execution or noting in the doc
that it applies to `Select Statement` and `Prepared Select Statement`.
##########
src/protocol/jdbc/src/main/java/org/apache/jmeter/protocol/jdbc/AbstractJDBCTestElement.java:
##########
@@ -679,6 +680,34 @@ public void setResultSetMaxRows(String resultSetMaxRows) {
this.resultSetMaxRows = resultSetMaxRows;
}
+ /**
+ * @return the integer representation of maxRows
+ */
+ public int getIntegerMaxRows() {
Review Comment:
Optional: this is the same parsing logic as `getIntegerResultSetMaxRows()`;
a shared private helper would avoid the duplication. Please also add `@since
6.0` to the Javadoc of the new public methods.
##########
xdocs/usermanual/component_reference.xml:
##########
@@ -670,7 +670,8 @@ the additional variables for rows four, five and six will
be removed.
</property>
<property name="Query timeout(s)" required="No">Set a timeout in
seconds for query, empty value means 0 which is infinite. <code>-1</code> means
don't set any query timeout
which might be needed for use case or when certain drivers don't support
timeout. Defaults to 0.</property>
- <property name="Limit ResultSet" required="No">Limits the number of
rows to iterate through the ResultSet. Empty value means <code>-1</code>, e.g.
no limitation, which is also the default. This can help to reduce the amount of
data to be fetched from the database via the JDBC driver, but affects all
possible options of <code>Handle ResultSet</code> respectively – e.g.
incomplete ResultSet and a record count ≤ the limit.</property>
+ <property name="Limit ResultSet" required="No">Limits the number of
rows JMeter reads and processes from the ResultSet. Empty value means
<code>-1</code>, e.g. no limitation, which is also the default. This limits
client-side result handling; the JDBC driver and database may still process the
complete query result.</property>
Review Comment:
The previous text also said that the limit affects all the `Handle
ResultSet` options (incomplete ResultSet, record count ≤ the limit). That is
still true, so it would be worth keeping, for example:
```suggestion
<property name="Limit ResultSet" required="No">Limits the number of
rows JMeter reads and processes from the ResultSet. Empty value means
<code>-1</code>, e.g. no limitation, which is also the default. This limits
client-side result handling; the JDBC driver and database may still process the
complete query result. It affects all possible options of <code>Handle
ResultSet</code> respectively – e.g. incomplete ResultSet and a record count ≤
the limit.</property>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]