Reputation: 175
I am using Spring Batch using 2 (maybe more, assume 2 for simplicity) databases. One for storing all the job datas(all the BATCH_* tables). The other for actually running my business logic data. There are some things I dont quite understand.
Upvotes: 10
Views: 8317
Reputation: 2320
You can use a separate Transaction manager for tasks and the job repository. See here: http://forum.spring.io/forum/spring-projects/batch/39609-using-2-different-datasources-with-spring-batch
Thus, the need to designate two of them.
That being said, even though you can use two separate transaction managers, it doesn't mean that you should. If you don't go XA, then imagine what would happen if a business process ran successfully, but the job data wasn't saved. The next time the batch process ran, Spring Batch would think the job failed, and try to run it again.
Upvotes: 5