Skip to content

Add batch update support to JdbcClient - #37216

Merged
jhoeller merged 2 commits into
spring-projects:mainfrom
quaff:jdbcclient-batch-update
Sep 18, 2026
Merged

jhoeller merged 2 commits into
spring-projects:mainfrom
quaff:jdbcclient-batch-update

Conversation

@quaff

@quaff quaff commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

See #36944

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Aug 31, 2026
@bclozel bclozel added the in: data Issues in data modules (jdbc, orm, oxm, tx) label Aug 31, 2026
@jhoeller

jhoeller commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

This looks good for the purposes of #33843, thanks for all the efforts! We're considering inclusion in 7.1 M2.

In terms of API naming, pretty much my only concern is the repetition of the "batch" term in a batch()...batchUpdate() sequence. I suppose we could simply name the latter update(), even if it returns an int[] since it naturally executes a batch at the end of a fluent batch call sequence?

@jhoeller jhoeller self-assigned this Sep 16, 2026
Empatixx and others added 2 commits September 17, 2026 09:15
Introduce a fluent batch() operation on JdbcClient.StatementSpec that
accumulates several sets of parameters - bound as positional or named
parameters in the same fashion as a single update, separated by add() -
and executes them as a single JDBC batch through update(). Batch updates
previously required dropping down to JdbcTemplate or NamedParameterJdbcTemplate.

Closes spring-projectsgh-33843

Signed-off-by: Jiří Krokviak <j.krokviak@gmail.com>
Co-authored-by: Yanming Zhou <zhouyanming@gmail.com>
See spring-projectsGH-36944

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
@quaff
quaff force-pushed the jdbcclient-batch-update branch from 5d5d574 to f63afc3 Compare September 17, 2026 01:20
@quaff

quaff commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

This looks good for the purposes of #33843, thanks for all the efforts! We're considering inclusion in 7.1 M2.

In terms of API naming, pretty much my only concern is the repetition of the "batch" term in a batch()...batchUpdate() sequence. I suppose we could simply name the latter update(), even if it returns an int[] since it naturally executes a batch at the end of a fluent batch call sequence?

PR updated for renaming, please review @jhoeller

@bclozel bclozel added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Sep 17, 2026
@bclozel bclozel added this to the 7.1.0-M2 milestone Sep 17, 2026
@jhoeller
jhoeller merged commit 94e6e0c into spring-projects:main Sep 18, 2026
3 checks passed
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.

5 participants