Skip to content

When I do not use transactions, if the Tasklet throws an exception, it continues to execute #4891

@madoka109

Description

@madoka109

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions