为什么Spring Batch从MASTER而不是从用户定义的架构中读取元数据表? [英] Why Spring Batch reads metadata tables from MASTER and not from User defined Schema?
问题描述
我有一个Spring Boot Batch应用程序。在application.properties中,我按如下所示指定我的数据源详细信息
I have a spring boot batch application. In application.properties, i specify my datasource details as follows
spring.datasource.url=jdbc:jtds:sqlserver://1*.2**.6*.25:14**
spring.datasource.database=MYDB_DEV
spring.datasource.username=username
spring.datasource.password=password
问题是,当我运行批处理作业时,所有用户定义的表都来自MYDB_DEV。但是,即使我在MYDB_DEV中创建了相同的表,诸如BATCH_JOB_EXECUTION,BATCH_JOB_EXECUTION_CONTEXT之类的元数据表还是从MASTER模式中获取的。为什么会这样?有什么办法可以使应用程序从用户定义的架构中读取元数据表?
The problem is, when i run the batch job, all user defined tables are taken from the MYDB_DEV. But Metadata tables like BATCH_JOB_EXECUTION, BATCH_JOB_EXECUTION_CONTEXT are taken from the MASTER schema even though i have created the same tables in MYDB_DEV. Why this happens? Is there any work around to make the application read Metadata tables from user defined schema?
我已经调试了jobLauncher.run(myjob,jobParameters),但是找不到从主架构那里获取线索
I have debugged though the jobLauncher.run(myjob, jobParameters), Could not find any lead from where it is taking master Schema
推荐答案
在application.properties或application.yml中使用以下属性
Use below property in application.properties or application.yml
spring.batch.tablePrefix = MYDB_DEV.BATCH _
spring.batch.tablePrefix=MYDB_DEV.BATCH_
这篇关于为什么Spring Batch从MASTER而不是从用户定义的架构中读取元数据表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!