My project does batch processing and is trying to use 2 datasources (oracle) (one for spring metadata and second for application).
The sample configuration is in github project (github.com/jobas2007/spring_proj) , but because there are 2 transaction manager/datasource configured, there appears to be inconsistency in managing transaction across commits being done for 2 datasources. The Primary datasource (for batch) commits are happening correctly, but when finally doing "save" in ItemWriter, very unpredictable behavior is observed during save/update to application tables.
Please advise a good way to manage transaction between multiple datasources?
As per link https://blog.codecentric.de/en/2012/03/transactions-in-spring-batch-part-1-the-basics/ , Tx starts for a chunk when entering step
Tried suggestion from one of the post to use 'ChainedTransactionManager' but facing major issues in wiring Use of multiple DataSources in Spring Batch
code is in github
expected result is to have predictable robust tx management