The problem still exist in 5.9 and 5.10. The configuration attribute "databaseSchema" is not distributed to the org.activiti.engine.impl.db.DbSqlSession. At schema update/creation time the openSession() method at org.activiti.engine.impl.db.DbSqlSessionFactory is called, wich results in using the "simple" constructor of org.activiti.engine.impl.db.DbSqlSession. In this constructor the class attributes connectionMetadataDefaultCatalog and connectionMetadataDefaultSchema where not initialized, thus resulting in the error.
There exist two constructors in the DbSqlSessionFactory, one without "defaultSchema" and "defaultCatalog" attributes and one with:
public DbSqlSession(DbSqlSessionFactory dbSqlSessionFactory) {
this.dbSqlSessionFactory = dbSqlSessionFactory;
this.sqlSession = dbSqlSessionFactory
.getSqlSessionFactory()
.openSession();
}
public DbSqlSession(DbSqlSessionFactory dbSqlSessionFactory, Connection connection, String catalog, String schema) {
this.dbSqlSessionFactory = dbSqlSessionFactory;
this.sqlSession = dbSqlSessionFactory
.getSqlSessionFactory()
.openSession(connection);
this.connectionMetadataDefaultCatalog = catalog;
this.connectionMetadataDefaultSchema = schema;
}
the databaseSchema is now exposed via the configuration. That should do the job or is the connectionMetadataDefaultCatalog really needed? Please reopen the issue if this is the case and give some more information on this.