Multi tenancy with one process engine per tenant


#1

I am trying to setup multi tenancy with multiple schemas and one process engine per tenant. I am following this tutorial https://docs.camunda.org/manual/7.5/examples/tutorials/multi-tenancy/.

2 H2 schemas were created TENANT1 & TENENT2, then created tables and indexes inside these 2 schemas. Please find below the app context file that I am using. While starting the application I am getting Schema “TENANT1” not found. Can you please help me on this?

<bean id="dataSource"
	class="org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy">
	<property name="targetDataSource">
		<bean class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
			<property name="driverClass" value="org.h2.Driver" />
			<property name="url"
				value="jdbc:h2:C:/h2/bpm-multitenancy/PROCESS_ENGINE" />
			<property name="username" value="sa" />
			<property name="password" value="" />
		</bean>
	</property>
</bean>

<bean id="transactionManager"
	class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
	<property name="dataSource" ref="dataSource" />
</bean>

<bean id="processEngineConfiguration1"
	class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">
	<property name="processEngineName" value="engine1" />
	<property name="dataSource" ref="dataSource" />
	<property name="transactionManager" ref="transactionManager" />
	<property name="databaseSchemaUpdate" value="false" />
	<property name="jobExecutorActivate" value="false" />
	<property name="databaseTablePrefix" value="TENANT1." />
</bean>

<bean id="processEngineConfiguration2"
	class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">
	<property name="processEngineName" value="engine2" />
	<property name="dataSource" ref="dataSource" />
	<property name="transactionManager" ref="transactionManager" />
	<property name="databaseSchemaUpdate" value="false" />
	<property name="jobExecutorActivate" value="false" />
	<property name="databaseTablePrefix" value="TENANT2." />
</bean>

<bean id="processEngine1" class="org.camunda.bpm.engine.spring.ProcessEngineFactoryBean">
	<property name="processEngineConfiguration" ref="processEngineConfiguration1" />		
</bean>

<bean id="processEngine2" class="org.camunda.bpm.engine.spring.ProcessEngineFactoryBean">
	<property name="processEngineConfiguration" ref="processEngineConfiguration2" />		
</bean>

<bean id="repositoryService1" factory-bean="processEngine1"
	factory-method="getRepositoryService" />
<bean id="runtimeService1" factory-bean="processEngine1"
	factory-method="getRuntimeService" />
<bean id="taskService1" factory-bean="processEngine1"
	factory-method="getTaskService" />
<bean id="historyService1" factory-bean="processEngine1"
	factory-method="getHistoryService" />
<bean id="managementService1" factory-bean="processEngine1"
	factory-method="getManagementService" />
	
<bean id="repositoryService2" factory-bean="processEngine2"
	factory-method="getRepositoryService" />
<bean id="runtimeService2" factory-bean="processEngine2"
	factory-method="getRuntimeService" />
<bean id="taskService2" factory-bean="processEngine2"
	factory-method="getTaskService" />
<bean id="historyService2" factory-bean="processEngine2"
	factory-method="getHistoryService" />
<bean id="managementService2" factory-bean="processEngine2"
	factory-method="getManagementService" />