spring-projects / spring-projects/spring-batch
When I do not use transactions, if the Tasklet throws an exception, it continues to execute
Open
Nobody has claimed this yet.
has: minimal-example
has: votes
in: core
type: bug
- Dominant language
- Java
- Stars
- 3k
- Forks
- 2.5k
- Avg merge
- 6d 53m
- Merged PRs (30d)
- 3
Description
private TransactionAttribute getTransactionAttribute() {
RuleBasedTransactionAttribute attribute = new RuleBasedTransactionAttribute();
attribute.setPropagationBehavior(TransactionDefinition.PROPAGATION_NOT_SUPPORTED);
return attribute;
}
@Slf4j
@Component
public class XxxTasklet implements Tasklet {
@Override
public RepeatStatus execute(StepContribution stepContribution, ChunkContext chunkContext) throws Exception {
try {
throw new Exception("test");
} catch (Exception e) {
log.error("test error");
throw new Exception("test error");
}
}
}
This is my code
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The report identifies getTransactionAttribute() and XxxTasklet.execute(...); start by reproducing the non-transactional Tasklet with the shown exception and tracing whether execution continues afterward. Clarify the expected stop behavior and add a regression test for that scenario; done means the observed execution matches the agreed behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100