Consistently apply table prefix

Make sure that if a custom table prefix is specified, it is set on the
JobRepository as well.

Closes gh-3798
This commit is contained in:
madorb 2015-08-24 23:06:18 -05:00 committed by Stephane Nicoll
parent 19fe86169f
commit b69152571e
1 changed files with 4 additions and 0 deletions

View File

@ -140,6 +140,10 @@ class BasicBatchConfigurer implements BatchConfigurer {
logger.warn("JPA does not support custom isolation levels, so locks may not be taken when launching Jobs");
factory.setIsolationLevelForCreate("ISOLATION_DEFAULT");
}
String tablePrefix = this.properties.getTablePrefix();
if (StringUtils.hasText(tablePrefix)) {
factory.setTablePrefix(tablePrefix);
}
factory.setTransactionManager(getTransactionManager());
factory.afterPropertiesSet();
return factory.getObject();