Custom Database schema on PostgreSQL not working

Description

Configure in code as follows:

final CdiJtaProcessEngineConfiguration processEngineConfiguration = new CdiJtaProcessEngineConfiguration();
processEngineConfiguration.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_CREATE_DROP);

//---------------------------------------------------
processEngineConfiguration.setDatabaseSchema("my_custom_schema");
//---------------------------------------------------

processEngineConfiguration.setProcessEngineName("default");
processEngineConfiguration.setDataSourceJndiName(Constants.JNDI_SMLP_DATASOURCE);
processEngineConfiguration.setTransactionManager(lookupTransactionManager());
processEngineConfiguration.setTransactionsExternallyManaged(true);
processEngineConfiguration.setJobExecutorActivate(true);

==NOTES===

  • Created database in postgres. JNDI lookup to that database occurs in code.

  • Database contains public schema (default) and my_custom_schema as well.

  • If I omit the code where I set the database schema (between the ---------- above), Activiti will create all necessary tables in the default (public) schema.

  • If I insert the line (version 5.15), it is ignored and the tables are created in the public schema anyway.

  • If I insert that line (version 5.10), I get the error as seen below:

==================================
org.activiti.engine.ActivitiException: Activiti database problem: Tables missing for component(s) engine, history, identity
at org.activiti.engine.impl.db.DbSqlSession.dbSchemaCheckVersion(DbSqlSession.java:546)
at org.activiti.engine.impl.db.DbSqlSession.performSchemaOperationsProcessEngineBuild(DbSqlSession.java:907)
at org.activiti.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:25)
at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
at org.activiti.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:59)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:77)
at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:301)

Environment

Kubuntu 12.10
Java 7
Wildfly 8 Final
Postgres 9.1+136

Status

Assignee

Tijs Rademakers

Reporter

Andries E

Labels

None

Fix versions

Affects versions

Priority

Major
Configure