我可以在同一数据库中使用不同架构的两个Spring Boot Camunda应用程序

问题描述 投票:0回答:1

我正在尝试启动两个不同的Spring Boot Camunda应用程序。第一个启动完全正常,并在数据库中创建表和所有内容。但是,当我尝试启动第二个应用程序时,它失败了。明确地说,我希望应用程序将它们的架构作为自己的数据库来体验,如果有道理的话。引导第二个Spring Boot Application时出现的错误是:

ENGINE-16004 Exception while closing command context: 
### Error querying database.  Cause: org.postgresql.util.PSQLException: ERROR: relation "act_ge_property" does not exist
  Position: 15
### The error may exist in org/camunda/bpm/engine/impl/mapping/entity/Property.xml
### The error may involve org.camunda.bpm.engine.impl.persistence.entity.PropertyEntity.selectProperty-Inline
### The error occurred while setting parameters
### SQL: select * from ACT_GE_PROPERTY where NAME_ = ?
### Cause: org.postgresql.util.PSQLException: ERROR: relation "act_ge_property" does not exist
  Position: 15

我只有一个Postgres数据库,但是应用程序使用不同的用户名/密码连接到该数据库。他们的用户拥有自己的架构,并且无法访问数据库中的其他架构。为两个应用程序设置了以下应用程序属性:camunda.bpm.datasource.schema-update=true。阅读有关Camunda的文档后,我可以看到.schema-update=true应该创建表(如果它们不存在)。我不明白为什么第二个应用程序不创建表。

对于Postgres模式配置,我使用以下命令创建它们:

CREATE USER applicationName WITH PASSWORD 'r4nd0m';
CREATE SCHEMA AUTHORIZATION applicationName;

我不知道问题出在配置Camunda应用程序还是有关模式的特权/创建。

任何帮助将不胜感激!

postgresql spring-boot camunda
1个回答
0
投票

是,可以。如果我正确理解了您的要求,那么该项目将向您展示如何:

https://github.com/rob2universe/two-camunda-instances

© www.soinside.com 2019 - 2024. All rights reserved.