Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent transaction manager configuration between XML and Java config styles #4130

Closed
fmbenhassine opened this issue Jun 10, 2022 · 0 comments

Comments

@fmbenhassine
Copy link
Contributor

fmbenhassine commented Jun 10, 2022

With the XML configuration style, the transaction manager is configurable as an attribute of the tasklet element. This means other step types (partition step, flow step, etc) do not have this attribute, which makes sense since those step types do not require a transaction manager by design (see here).

With Java configuration on the other hand, the transaction manager is configurable at the StepBuilderHelper level, which is common to all step builders. While this is not an issue in itself, it requires the configuration of something that is not required in the first place, in addition to introducing an inconsistency between the two configuration styles:

step-builders

The transaction manager configuration should be moved down from StepBuilderHelper to AbstractTaskletStepBuilder in order to make this consistent with XML config.

@fmbenhassine fmbenhassine added this to the 5.0.0 milestone Jun 10, 2022
@fmbenhassine fmbenhassine modified the milestones: 5.0.0, 5.0.0-M6 Aug 31, 2022
fmbenhassine added a commit to fmbenhassine/spring-batch that referenced this issue Sep 5, 2022
Before this commit, the transaction manager was configurable
at the StepBuilder level, which is inconsistent with the XML
config style in addition to be not needed for most step types.

This commit moves the configuration of the transaction manager
from the StepBuilder down to the AbstractTaskletStepBuilder,
which is the level where the transaction manager is needed.

Issue spring-projects#4130
wilkinsona added a commit to spring-projects/spring-boot that referenced this issue Sep 8, 2022
snicoll pushed a commit to spring-projects/spring-aot-smoke-tests that referenced this issue Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant