java - JobExplorer spring 批处理和表前缀

标签 java spring batch-file

是否真的需要为 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/

相关文章:

mysql - Spring Boot+Hibernate向mysql插入空值

string - 如何将包含特定字符串的行的行号存储在环境变量中的文本文件中?

windows - 从 Visual Studio 2013 命令提示符追加到 INCLUDE 环境变量

windows - "findstr"Windows 命令排除评论中的搜索

java - 在 AOSP、Android 中定义单例

java - Processbuilder-在linux中打开java脚本

java - 为什么在 mongodb 中调用 MongoClient 实例时打开 2 个连接

java - JavaFX 应用程序线程中按 ENTER 键时出现 NullPointerException

java - Spring 3.1 和 Hibernate 4 : "HibernateException: No Session found for current thread" When calling DAO method from unit test

java - 在 Spring 数据注释中混合