Upgrading org.springframework:spring-jdbc 6 to 7
Breaking6.2.19 → 7.0.10Breaking23Security18Deprecated17New204Changed270Fixed290Other154
BreakingUpgrade verdict
23 breaking changes and 18 security fixes.
In plain terms
- SpEL expressions evaluated in the restricted context are no longer compiled for speed unless you explicitly ask for it.
- Simplifies TransactionalOperator.executeAndAwait by removing Optional from its signature.
- Renames maxAttempts to maxRetries in @Retryable and RetryPolicy.
- Removes the Hamcrest dependency from RestTestClient.
Must act Top 5 of 58 that need code or config changes
org.springframework:spring-jdbc publishes an official migration guide for version 7. It covers more than the release notes do.
The official release notes and upgrade guide ↗Installs 5 packages in all (was 4).
Also installs commons-logging:commons-logging, org.jspecify:jspecify.
No longer installs org.springframework:spring-jcl.
3 packages of its own release move with it.
What you must change
Breaking23
SimpleEvaluationContext no longer supports expression compilation by default; opt in via withCompilationSupported().
SimpleEvaluationContextSpelParserConfigurationspring.expression.compiler.modewithCompilationSupported()Simplifies TransactionalOperator.executeAndAwait by removing Optional from its signature.
TransactionalOperatorexecuteAndAwaitOptionalRenames maxAttempts to maxRetries in @Retryable and RetryPolicy.
@RetryableRetryPolicymaxAttemptsmaxRetriesRemoves the Hamcrest dependency from RestTestClient.
RestTestClientRemoves support for callable references in
BeanRegistrarDsl.BeanRegistrarDslRemoves HttpServiceClient annotation support.
HttpServiceClientRemoves maxDuration and maxElapsedTime support from RetryPolicy.
RetryPolicymaxDurationmaxElapsedTimeRemoves
(String, String) variants of setProperty() and withProperty() from MockEnvironment.MockEnvironment.setProperty()MockEnvironment.withProperty()Removes support for Aware interfaces in BeanRegistrar.
AwareBeanRegistrarRemoves the deprecated rowsExpected property of SqlQuery.
SqlQueryrowsExpectedRemoves convention-based annotation attribute override support.
Removes Netty 5 support.
Removes binary array name handling in ClassUtils.forName().
ClassUtils.forName()Remove path mapping options marked as deprecated for removal.
ForwardedHeaderFilter and ForwardedHeaderTransformer add a boolean constructor argument to choose standard Forwarded or X-Forwarded headers.
ForwardedHeaderFilterForwardedHeaderTransformerApiVersionConfigurer.setSupportedVersionPredicate() now returns void instead of ApiVersionConfigurer.
ApiVersionConfigurer.setSupportedVersionPredicate()Revises ApplicationContext#getId() nullability to non-null.
ApplicationContext#getId()Changes canRead/canWrite overrides to Class ones in AbstractSmartHttpMessageConverter.
AbstractSmartHttpMessageConvertercanReadcanWriteMakes RetryException#getCause non-nullable.
RetryExceptiongetCauseReplaces
useRequestParam with useQueryParam in ApiVersionConfigurer to align with the client.ApiVersionConfigureruseRequestParamuseQueryParamMigrates the orm.hibernate5 package to orm.jpa.hibernate for Hibernate ORM 7.0.
orm.hibernate5orm.jpa.hibernateRedesigns RetryPolicy to directly incorporate BackOff.
RetryPolicyBackOffMakes built-in RetryPolicy implementations final.
RetryPolicySecurity18
Limits result size of BigDecimal/BigInteger power operations in SpEL.
BigDecimalBigIntegerFixes CVE-2026-41838, a predictable session ID issue in the WebSocket module.
Fixes CVE-2026-41839, a privilege escalation via session fixation in WebFlux.
Fixes CVE-2026-41840, a denial of service via multipart requests in WebFlux.
Fixes CVE-2026-41841, an information disclosure via static resource cache in Spring MVC and WebFlux.
Fixes CVE-2026-41842, a denial of service via versioned resources in Spring MVC and WebFlux.
Fixes CVE-2026-41843, a path traversal via versioned static resources in Spring MVC and WebFlux.
Fixes CVE-2026-41844, an open redirect in Spring MVC and WebFlux.
Fixes CVE-2026-41845, a cross-site scripting issue via JavaScriptUtils.
JavaScriptUtilsFixes CVE-2026-41846, a cross-site scripting issue via JSP form tags.
Fixes CVE-2026-41848, a denial of service via AntPathMatcher.
AntPathMatcherFixes CVE-2026-41850, an algorithmic denial of service via SpEL expressions.
Fixes CVE-2026-41851, a denial of service via an unbounded cache in SpEL.
Fixes CVE-2026-41852, arbitrary method invocation in SpEL expressions.
Fixes CVE-2026-41853, multipart request smuggling in Spring MVC and WebFlux.
Fixes CVE-2026-41854, a server-side request forgery via UriComponentsBuilder.
UriComponentsBuilderFixes CVE-2026-41855, unsafe deserialization via Jackson JMS converters.
Warns against unsafe static resource locations in MVC and WebFlux.
Deprecations to plan for
Deprecated17
Deprecates methodIdentification() in CacheAspectSupport for removal.
CacheAspectSupport.methodIdentification()Deprecates PagedListHolder and PropertyComparator for removal.
PagedListHolderPropertyComparatorNotes that deprecated MockMvcClientHttpRequestFactory is required for tests with HTTP service interface proxy.
MockMvcClientHttpRequestFactoryDeprecates the BeanShell scripting support.
Deprecates the
lang XML namespace.langDeprecates Hamcrest methods in WebTestClient.
WebTestClientDeprecates TransactionCallbackWithoutResult.
TransactionCallbackWithoutResultDeprecate the org.springframework.web.servlet.view.document package.
org.springframework.web.servlet.view.documentDeprecates put(MergedContextConfiguration, ApplicationContext) in ContextCache.
ContextCacheput(MergedContextConfiguration, ApplicationContext)MergedContextConfigurationApplicationContextDeprecates the DaoSupport classes.
DaoSupportDeprecates PropertyPlaceholderConfigurer and PreferencesPlaceholderConfigurer for removal.
PropertyPlaceholderConfigurerPreferencesPlaceholderConfigurerDeprecates JUnit 4 support in the Spring TestContext Framework.
TestContextDeprecate PathExtensionPredicate in functional web frameworks.
PathExtensionPredicateDeprecate mvc XML configuration namespace.
Deprecate HandlerMappingIntrospector.
HandlerMappingIntrospectorDeprecate use of PathMatcher in web modules.
PathMatcherDeprecate use of several bean factory methods for the same bean in a configuration class.
API changes
Generated by DepDelta from published JVM bytecode. Not mixed with prose notes.
- added:
ctor JdbcTemplate(JdbcAccessor) - added:
ctor RowMapperResultSetExtractor(RowMapper, int, int) - added:
ctor SingleColumnRowMapper(Class, ConversionService) - added:
static method JdbcOperationsExtensionsKt.query(JdbcOperations, String, Object[], Function1): Object
- added:
ctor NamedParameterJdbcTemplate(NamedParameterJdbcTemplate, JdbcTemplate)
- added:
method JdbcClient.StatementSpec.withFetchSize(int): JdbcClient.StatementSpec - added:
method JdbcClient.StatementSpec.withMaxRows(int): JdbcClient.StatementSpec - added:
method JdbcClient.StatementSpec.withQueryTimeout(int): JdbcClient.StatementSpec - added:
static method JdbcClient.create(NamedParameterJdbcOperations, ConversionService): JdbcClient
- removed:
method SqlQuery.getRowsExpected(): int - removed:
method SqlQuery.setRowsExpected(int): void - added:
method SqlQuery.stream(): Stream - added:
method SqlQuery.stream(Map): Stream - added:
method SqlQuery.stream(Object[]): Stream - added:
method SqlQuery.stream(Object[], Map): Stream - added:
method SqlQuery.streamByNamedParam(Map): Stream - added:
method SqlQuery.streamByNamedParam(Map, Map): Stream
- added:
class SqliteMaxValueIncrementer extends AbstractColumnMaxValueIncrementer - added:
ctor SqliteMaxValueIncrementer() - added:
ctor SqliteMaxValueIncrementer(DataSource, String, String) - added:
method SqliteMaxValueIncrementer.getNextKey(): long