Skip to content

8388810: Exceeding CachedRowSet max rows should only warn once - #32033

Closed
justin-curtis-lu wants to merge 2 commits into
openjdk:masterfrom
justin-curtis-lu:cachedRowSetImpl-warnings
Closed

8388810: Exceeding CachedRowSet max rows should only warn once#32033
justin-curtis-lu wants to merge 2 commits into
openjdk:masterfrom
justin-curtis-lu:cachedRowSetImpl-warnings

Conversation

@justin-curtis-lu

@justin-curtis-lu justin-curtis-lu commented Jul 23, 2026

Copy link
Copy Markdown
Member

Ensure that the implementation does not generate subsequent warnings for each row exceeded above the maximum allowed.

Additional fixes included

  • crs created via hashtable c-tor no longer throws NPE when its warning is referenced.
  • 2-arg populate uses setWarning with a RowSetWarning which fixes the issue when the warning was polled by client and an Error occurred, because setException does not expect an SQLException
  • Root warning is no longer a pointless blank warning. The root warning now always contains a valid warning message.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8388810: Exceeding CachedRowSet max rows should only warn once (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/32033/head:pull/32033
$ git checkout pull/32033

Update a local copy of the PR:
$ git checkout pull/32033
$ git pull https://git.openjdk.org/jdk.git pull/32033/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 32033

View PR using the GUI difftool:
$ git pr show -t 32033

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32033.diff

Using Webrev

Link to Webrev Comment

insertRow = null;

// set the warnings
sqlwarn = new SQLWarning();

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sqlwarn does not get a addRowSetWarning style method because it is unused by the implementation.

@bridgekeeper

bridgekeeper Bot commented Jul 23, 2026

Copy link
Copy Markdown

👋 Welcome back jlu! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk

openjdk Bot commented Jul 23, 2026

Copy link
Copy Markdown

@justin-curtis-lu This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8388810: Exceeding CachedRowSet max rows should only warn once

Reviewed-by: lancea

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 50 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

rowsetWarning.setNextException(new SQLException("Populating rows "
+ "setting has exceeded max row setting"));
if (rowsFetched >= mRows && mRows > 0) {
addRowSetWarning(MAX_ROW_WARNING);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exceededMax is not required for the 2-arg populate because the existing code already breaks out of processing altogether when the max is encountered.

@openjdk openjdk Bot added the core-libs core-libs-dev@openjdk.org label Jul 23, 2026
@openjdk

openjdk Bot commented Jul 23, 2026

Copy link
Copy Markdown

@justin-curtis-lu The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added these warning tests as a standalone test file, since test/jdk/javax/sql/test/rowset/cachedrowset/CachedRowSetTests.java is better reserved for the common test suite.

*/
private void addRowSetWarning(String reason) {
if (rowsetWarning == null) {
rowsetWarning = new RowSetWarning(reason);

@justin-curtis-lu justin-curtis-lu Jul 23, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I consider it a bug that the root warning was always empty in the original code, I can revert this change to the original behavior if we think there is risk.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fine

@justin-curtis-lu justin-curtis-lu changed the title 8388810: Exceeding CachedRowSet max rows should warn once 8388810: Exceeding CachedRowSet max rows should only warn once Jul 23, 2026
@justin-curtis-lu
justin-curtis-lu marked this pull request as ready for review July 23, 2026 21:51
@openjdk openjdk Bot added the rfr Pull request is ready for review label Jul 23, 2026
@mlbridge

mlbridge Bot commented Jul 23, 2026

Copy link
Copy Markdown

Webrevs

@LanceAndersen LanceAndersen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good Justin

*/
private void addRowSetWarning(String reason) {
if (rowsetWarning == null) {
rowsetWarning = new RowSetWarning(reason);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fine

@openjdk openjdk Bot added the ready Pull request is ready to be integrated label Jul 24, 2026
@justin-curtis-lu

Copy link
Copy Markdown
Member Author

/integrate

@openjdk

openjdk Bot commented Jul 27, 2026

Copy link
Copy Markdown

Going to push as commit 79d629a.
Since your change was applied there have been 61 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

@openjdk openjdk Bot added the integrated Pull request has been integrated label Jul 27, 2026
@openjdk openjdk Bot closed this Jul 27, 2026
@openjdk openjdk Bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 27, 2026
@openjdk

openjdk Bot commented Jul 27, 2026

Copy link
Copy Markdown

@justin-curtis-lu Pushed as commit 79d629a.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-libs core-libs-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

2 participants