My main job does only read operations and the other one does some writing but on MyISAM engine
which ignores transactions, so I wouldn\'t require necessarily tr
Have you tried something like this already?
@Bean(name="batchDataSource")
public DataSource batchDataSource(){
return DataSourceBuilder.create()
.url(env.getProperty("batchdb.url"))
.driverClassName(env.getProperty("batchdb.driver"))
.username(env.getProperty("batchdb.username"))
.password(env.getProperty("batchdb.password"))
.build();
}
and then mark the other datasource with a @Primary, and use an @Qualifier in your batch config to specify that you want to auotwire the batchDataSource bean.