Seperate datasource for jobrepository and writer of Spring Batch

旧街凉风 提交于 2019-11-28 10:12:19

问题


Job is simple CSVtoDBFileWriter :

  1. read CSV fileName and location from oracle1
  2. read CSV file(batchreader)
  3. write(batch writer) in tables(oracle2)

I have 2 datasource :

  • Oracle1

          : available when application context loads and 
          : I read properties from Oracle1's tables to create oracle2
          : jobRepository related tables should be stored here(oracle1)
    
  • Oracle2 : Destination database where Spring batch's writer will finally output.

Question1 : Do I need XA transactionManager?

Question2 : Can I run this application in production only using Spring Boot, are there challanges with Spring Boot in production?


回答1:


You only need XA transaction when SB metadata tables are stored in a different database than the one using for data writing because checkpoint (data and SB metadata) must be stored at the same time to take care of synchronization and restartability.
Reading can be done from a different datasource without problems because reading is unrelated respect to where SB metadata are saved.



来源:https://stackoverflow.com/questions/26820818/seperate-datasource-for-jobrepository-and-writer-of-spring-batch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!