Transaction management with Spring Batch

前端 未结 2 1540
你的背包
你的背包 2020-12-08 08:59

I am discovering actually Spring and I am able to setup some jobs. Now, I would like to save my imported datas in a database using Hibernate/JPA and I keep getting this erro

2条回答
  •  星月不相逢
    2020-12-08 09:14

    You need to explicitly reference your Transaction Manager in your step definition:

    
        
            
                
            
        
    
    

    See: 5.1.1. Configuring a Step


    Ah, seeing that you use JavaConfig, you need to assign the transaction manager to the TaskletStepBuilder using builder.transactionManager(transactionManager) (inherited from StepBuilderHelper)

提交回复
热议问题