Why Spring Batch reads metadata tables from MASTER and not from User defined Schema?

落爺英雄遲暮 提交于 2019-12-25 00:11:48

问题


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

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?

I have debugged though the jobLauncher.run(myjob, jobParameters), Could not find any lead from where it is taking master Schema


回答1:


Use below property in application.properties or application.yml

spring.batch.tablePrefix=MYDB_DEV.BATCH_



来源:https://stackoverflow.com/questions/56169099/why-spring-batch-reads-metadata-tables-from-master-and-not-from-user-defined-sch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!