Skip to content
Discussion options

You must be logged in to vote

Quote: it is known that using @Transactional methods with Spring Batch can cause issues

The "problem" with calling transitional methods within a tasklet is about transaction properties. The tasklet is already executed within the scope of a transaction driven by Spring Batch, so any call to an external method that is also defined to run in a transaction should be carefully considered, specifically the isolation level and the propagation behaviour : should that method participate in the current transaction driven by Spring Batch? or should it start its own transaction with Propagation.REQUIRES_NEW?

There is nothing that prevents you from calling transactional methods from within a tasklet…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@janossch
Comment options

Answer selected by janossch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
status: waiting-for-reporter Issues for which we are waiting for feedback from the reporter
2 participants