Hello
I've run into a problem with the sample jUnit tests from spring batch 2.1.0 RC1
I've changed the configuration from hsql to db2. When running the jUnit test DatabaseShutdownFunctionalTests, the tablePrefix is not set. When debugging the test, I see that the tableprefix from AbstractJdbcBatchMetadataDao is BATCH_, which later gets changed to userid.BATCH_. This will not work, as our tables have other prefixes.
In other jUnit Tests like BeanWrapperMapperSampleJobFunctionalTests, CompositeItemWriterSampleFunctionalTests and CustomerFilterJobFunctionalTests the table prefix is set properly.
I've set the table prefix in the jobRepository simple-job-launcher-context.xml:
and in all jdbctemplates:Code:<bean id="jobRepository" class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean" p:databaseType="db2" p:tablePrefix="DB2UTST.BATCH_"
Code:@Override public void afterRead(Long id) { int count = jdbcTemplate.update("UPDATE DB2UTST.BATCH_STAGING SET PROCESSED=? WHERE ID=? AND PROCESSED=?", StagingItemWriter.DONE, id, StagingItemWriter.NEW);
Other than changing the default-prefix in the class AbstractJdbcBatchMetadataDao, is there a way to inject this property somewhere?
Thanks a lot
Lorenz


Reply With Quote