Skip to content

Provide a configuration property for Spring Batch's validateTransactionState #44803

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

Closed
wants to merge 1 commit into from

Conversation

quaff
Copy link
Contributor

@quaff quaff commented Mar 20, 2025

No description provided.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 20, 2025
@wilkinsona wilkinsona changed the title Allow to configure validateTransactionState for Spring Batch Provide a configuration property for Spring Batch's validateTransactionState Mar 20, 2025
/**
* Whether to validate the transaction state.
*/
private Boolean validateTransactionState;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a boolean with a default value of true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should align with tablePrefix since it's not default to BATCH_, Spring Boot doesn't need to change if Spring Batch change its defaults, but many other AutoConfigurations doesn't work in such way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our approach has changed over time. These days, we prefer to provide a default if we can as it's better for users when looking at a property and its documentation, particularly in an IDE that supports that through the metadata. It's very unlikely that Batch will change its default. If it does, there's now a test in place that will fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we prefer to provide a default if we can as it's better for users when looking at a property and its documentation, particularly in an IDE that supports that through the metadata.

Then tablePrefix and isolationLevelForCreate should have default value.

@wilkinsona wilkinsona added for: merge-with-amendments Needs some changes when we merge and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 20, 2025
@wilkinsona wilkinsona added this to the 3.5.x milestone Mar 20, 2025
@wilkinsona wilkinsona self-assigned this Mar 20, 2025
@wilkinsona wilkinsona added the type: enhancement A general enhancement label Mar 20, 2025
@wilkinsona wilkinsona modified the milestones: 3.5.x, 3.5.0-M3 Mar 20, 2025
wilkinsona pushed a commit that referenced this pull request Mar 20, 2025
@wilkinsona
Copy link
Member

Thanks, @quaff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: merge-with-amendments Needs some changes when we merge type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants