Skip to content

Commit 9d322e9

Browse files
committed
Update whatsnew.adoc
1 parent ed945ca commit 9d322e9

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

spring-batch-docs/src/main/asciidoc/whatsnew.adoc

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ Spring Batch 5 is updating the dependencies across the board to the following ve
3636
* Spring for Apache Kafka 3
3737
* Micrometer 1.10
3838

39-
This release also marks the migration to Jakarta EE 9 APIs.
39+
This release also marks the migration to:
40+
41+
* Jakarta EE 9
42+
* Hibernate 6
4043

4144
[[batch-infrastructure-configuration-updates]]
4245
=== Batch Infrastructure Configuration Updates
@@ -45,6 +48,7 @@ Spring Batch 5 includes the following infrastructure configuration updates:
4548

4649
* <<datasource-requirement-updates>>
4750
* <<transaction-manager-bean-exposure>>
51+
* <<default-transaction-manager-type>>
4852

4953
[[datasource-requirement-updates]]
5054
==== DataSource Requirement Updates
@@ -65,14 +69,42 @@ context. While this was convenient in many cases, the unconditional exposure of
6569
interfere with a user-defined transaction manager. In this release, `@EnableBatchProcessing` no longer exposes a
6670
transaction manager bean in the application context.
6771

72+
[[default-transaction-manager-type]]
73+
==== Default Transaction Manager Type
74+
75+
When no transaction manager is specified, `@EnableBatchProcessing` used (up to version 4.3) to register a default
76+
transaction manager of type `org.springframework.jdbc.datasource.DataSourceTransactionManager` in the proxy around
77+
`JobRepository` when a `DataSource` bean is defined in the application context. In this release, the type of the
78+
default transaction manager has changed to `org.springframework.jdbc.support.JdbcTransactionManager`.
79+
6880
=== New features
6981

82+
==== Improved Java records support
83+
84+
The support for Java records as items in a chunk-oriented step has initially been introduced in v4.3,
85+
but that support was limited due to the fact that v4 has Java 8 as a baseline. The initial support was
86+
based on reflection tricks to create Java records and populate them with data, without having access to the
87+
`java.lang.Record` API that was finalised in Java 16.
88+
89+
Now that v5 has Java 17 as a baseline, we have improved records support in Spring Batch by leveraging the
90+
`Record` API in different parts of the framework. For example, the `FlatFileItemReaderBuilder` is now able
91+
to detect if the item type is a record or a regular class and configure the corresponding `FieldSetMapper`
92+
implementation accordingly (ie `RecordFieldSetMapper` for records and `BeanWrapperFieldSetMapper` for regular
93+
classes). The goal here is to make the configuration of the required `FieldSetMapper` type _transparent_ to the user.
94+
7095
==== Batch tracing with Micrometer
7196

7297
With the upgrade to Micrometer 1.10, you can now get batch tracing in addition to batch metrics.
7398
Spring Batch will create a span for each job and a span for each step within a job. This tracing
7499
meta-data can be collected and viewed on a dahsboard like link:$$https://zipkin.io$$[Zipkin] for example.
75100

101+
==== Java 8 features updates
102+
103+
We took the opportunity of this major release to improve the code base with features from Java 8+, for example:
104+
105+
* Use default methods in interfaces and deprecate "support" classes (see link:$$https://github.com/spring-projects/spring-batch/issues/3924$$[issue 3924])
106+
* Add `@FunctionalInterface` where appropriate in public APIs (see link:$$https://github.com/spring-projects/spring-batch/issues/4107$$[issue 4107])
107+
76108
==== Support for SAP HANA a job repository in Spring Batch
77109

78110
This release introduces the support of SAP HANA as an additional supported database for the job repository.

0 commit comments

Comments
 (0)