Skip to content

Deprecate multi-batch batchUpdate variant in JdbcTemplate #37345

Description

@jhoeller

JdbcTemplate acquired a multi-batch batchUpdate variant in 3.1 that was designed to split a given large collection of batch arguments into multiple batches of a specified size. This method and its ParameterizedPreparedStatementSetter callback interface were never mirrored in NamedParameterJdbcTemplate - and to this day, it is an odd one out on JdbcTemplate in terms of design.

Since there are no indications that modern-day JDBC drivers still suggest an external split into multiple batches, we do not intend to reflect this capability in the recent JdbcClient API. Due to the mismatch with NamedParameterJdbcTemplate and the unusual design, we rather intend to deprecate that multi-batch method on JdbcTemplate itself.

It is worth noting that batches can always be split up by the caller into multiple batchUpdate call sequences, if actually needed anywhere. There is no need to have this baked into Spring's JDBC client APIs as a first-class capability.

Activity

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

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)type: enhancementA general enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions