we are currently trying to get the schema based tenant isolation (MultiSchemaMultiTenantProcessEngineConfiguration) running on flowable 6.4.1 in combination with the flowable v5 embedded engine. However, this seems to be impossible due to some exceptions during startup of the flowable engine (see below).
The buildProcessEngine method of V6 internally tries to initialize a v5 process engine within a Command. However, this Command requires a database transaction which cannot be created at that point in time as the TenantAwareDataSource does not have an entry for the empty tenant (which is the one that is set on engine startup).
We would require some guidance on how this can be fixed.
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.flowable.common.engine.api.FlowableException: Could not find a dataSource for tenant “,”\tat org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:289)","\tat org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:377)","\tat org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)","\tat org.flowable.common.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:46)","\tat org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)","\tat org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)","\tat org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)","\tat org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:908)","\tat org.flowable.engine.impl.cfg.multitenant.MultiSchemaMultiTenantProcessEngineConfiguration.buildProcessEngine(MultiSchemaMultiTenantProcessEngineConfiguration.java:126)",
Looking at the code, it does look like combining multi-schema with v5 compatibility won’t work due to the chicken-or-egg problem of knowing which tenant to take (however the .getRawEngine() does need a command).
How are you initializing the TenantInfoHolder? Wouldn’t it work by setting some tenant value before booting up the engine?
Are you also using the multi-schema setup of the v5 engine?
If so, which database are you using it in? Which async executor do you use?
yesterday we took a deeper look into the issue. We anticipated your first question and tried to register a dummy tenant on engine boot (our tenants are normally initiated lazy; we don´t know them at engine boot or they might join dynamically).
With this change, we passed at least the transaction issue. However, then we ran into the below exception which indicates that the DefaultProcessEngineFactory does not handle the multi-schema case. Providing a dedicated ProcessEngineFactory that does not work as well as the corresponding classes that implement the multi-schema case are not included in the flowable5-engine module.
To answer your last two questions: Yes, we are using the multi-schema setup already today in v5 and want to use it in v6 as well. We are using a proprietary database which does not cause a problem so far. Regarding the async executor, we use the ExecutorPerTenantAsyncExecutor.
“Caused by: org.activiti.engine.ActivitiException: Unsupported process engine configuration”,