Job is simple CSVtoDBFileWriter :
- read CSV fileName and location from oracle1
- read CSV file(batchreader)
- 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?
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