Skip to content

Set first batch arg once while executing batch with generated keys - #37308

Merged
sbrannen merged 1 commit into
spring-projects:mainfrom
quaff:patch-155
Sep 21, 2026
Merged

sbrannen merged 1 commit into
spring-projects:mainfrom
quaff:patch-155

Conversation

@quaff

@quaff quaff commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

batchArgs[0] is already set by pscf::newPreparedStatementCreator, it is unnecessary to set it again by BatchPreparedStatementSetter::setValues.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 20, 2026
@quaff

quaff commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

Should I create a separated PR for second commit or keep it as is? it's related to new JdbcClient feature since 7.1.

@sbrannen sbrannen self-assigned this Sep 20, 2026
@sbrannen sbrannen added in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 20, 2026
@sbrannen sbrannen added this to the 7.1.x milestone Sep 20, 2026
@sbrannen

Copy link
Copy Markdown
Member

Should I create a separated PR for second commit or keep it as is? it's related to new JdbcClient feature since 7.1.

Since we typically squash commits in a PR before merging, it would be better to pre-squash them into a single commit with an all-encompassing title such as "Set first batch arg once while executing batch with generated keys". The commit message could then be a combination of the current two commit messages.

I'll go ahead and update the current PR title to reflect that.

@sbrannen sbrannen changed the title Improve NamedParameterJdbcTemplate to not set first batch args twice while executing batch with generated keys Set first batch arg once while executing batch with generated keys Sep 20, 2026
@sbrannen sbrannen added the status: waiting-for-feedback We need additional information before we can continue label Sep 20, 2026
@quaff

quaff commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

Should the first commit be backported to 6.x?

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Sep 21, 2026
@sbrannen

Copy link
Copy Markdown
Member

Should the first commit be backported to 6.x?

6.x is no longer under open source support, and this is more of an enhancement than a bug fix, so we don't plan to backport this.

@sbrannen sbrannen modified the milestones: 7.1.x, 7.1.0-RC1 Sep 21, 2026
@sbrannen sbrannen removed the status: feedback-provided Feedback has been provided label Sep 21, 2026
`batchArgs[0]` in `NamedParameterJdbcTemplate` and `indexedBatch[0]` in
`DefaultJdbcClient` are already set by
`pscf::newPreparedStatementCreator`, so it is unnecessary to set them
again via `BatchPreparedStatementSetter::setValues`.

Closes spring-projectsgh-37308

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
@sbrannen
sbrannen merged commit 6e5efdc into spring-projects:main Sep 21, 2026
2 checks passed
@sbrannen

Copy link
Copy Markdown
Member

This has been merged into main.

Thanks

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

Labels

in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants