@OnSkipInWrite is Not Called in SkipListener

前端 未结 3 1506
借酒劲吻你
借酒劲吻你 2021-01-26 06:32

I am reading the csv file and inserting data to database using spring batch(read,process and write).I am using \"jpaRepository.save\" in itemWriter class to save the data into t

3条回答
  •  孤街浪徒
    2021-01-26 07:27

    Try that in your BatchConf:

    @Bean
    @StepScope
    public StepExecutionListener stepExecutionListener() {
        return new StepExecutionListener();
    }
    

    ... .skipLimit(1) .listener(stepExecutionListener()
    .build();

提交回复
热议问题