connection.createStatement().execute("create schema SCHEMA1");
connection.createStatement().execute("create schema SCHEMA2");
connection.close();
// configure & build two different process engines, each having a separate table prefix
ProcessEngineConfigurationImpl config1 = createCustomProcessEngineConfiguration()
.setProcessEngineName("DatabaseTablePrefixTest-engine1")
.setDataSource(pooledDataSource)
.setDatabaseSchemaUpdate("NO_CHECK"); // disable auto create/drop schema
config1.setDatabaseTablePrefix("SCHEMA1.");
ProcessEngine engine1 = config1.buildProcessEngine();
ProcessEngineConfigurationImpl config2 = createCustomProcessEngineConfiguration()
.setProcessEngineName("DatabaseTablePrefixTest-engine2")
.setDataSource(pooledDataSource)
.setDatabaseSchemaUpdate("NO_CHECK"); // disable auto create/drop schema
config2.setDatabaseTablePrefix("SCHEMA2.");
ProcessEngine engine2 = config2.buildProcessEngine();
// create the tables in SCHEMA1
connection = pooledDataSource.getConnection();
connection.createStatement().execute("set schema SCHEMA1");
engine1.getManagementService().databaseSchemaUpgrade(connection, "", "SCHEMA1");