是否真的需要为 jobExplorer bean 更改 jobRepository 表的表前缀?
文档对此是这样描述的:
Earlier in this chapter, it was mentioned that the table prefix of the JobRepository can be modified to allow for different versions or schemas. Because the JobExplorer is working with the same tables, it too needs the ability to set a prefix:
class="org.spr...JobExplorerFactoryBean"p:dataSource-ref="dataSource"p:tablePrefix="BATCH_"/>
如果 jobExplorer 仅用于阅读目的..为什么我们应该为此拥有另一组 jobRepository 表?
最佳答案
您应该只有一组用于 jobRepository 和 jobExplorer 的表。如果您不显式更改它(通常不会),这两个 bean 都将使用默认表前缀 BATCH_。 该文档仅指出,如果您在配置 jobRepository 时更改了表前缀那么请确保您还更改了 jobExplorer 的表前缀以确保两者都是使用同一批数据库表。
关于java - JobExplorer spring 批处理和表前缀,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35131131/