Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Overriding transaction management [BATCH-2294] #1289
SimpleBatchConfiguration which gets loaded by any of spring application, created transactionManager bean irrespective of whether that bean is already created or not. This results in overriding transaction manager
Reference URL: http://stackoverflow.com/q/25303163/3073323
Backported to: 4.1.0.M3
3 votes, 5 watchers
Thiago B. Negri commented
I'm facing the same issue.
As a workaround I've defined the exact same transaction manager I already have defined in other configuration class in my Spring Batch configuration class. So my application starts defining my transaction manager, then gets overridden by Spring Batch transaction manager and then gets overridden by my second definition of the transaction manager.
Martin Meyer commented
I'm not sure what this magic
Basically I just try to autowire a transaction manager and make a new one only if there isn't one.
Mahmoud Ben Hassine commented
This issue is resolved with #634.
In order to provide a custom transaction manager, a custom
Documentation was updated accordingly (See https://github.com/spring-projects/spring-batch/pull/620/files).