cancel
Showing results for 
Search instead for 
Did you mean: 

Tables missing for component(s) engine, history, identity

rolf
Champ in-the-making
Champ in-the-making
Hello!

I'm new to activiti and need some help…

I want to integrate activiti into an existing oracle 11 database.
I've created a new schema "activiti" with all the tables.

I must log on to the databse with a specific user e.g. "SUPPORT_USER".

I use this configuration:

setDatabaseSchemaUpdate(false);
setDatabaseSchema("ACTIVITI");
setDatabaseTablePrefix("ACTIVITI.");

I get this exception:
org.activiti.engine.ActivitiException: Activiti database problem: Tables missing for component(s) engine, history, identity

The problem is in DbSqlSession:
- dbSchemaCheckVersion calls "getDbVersion()" to get the version:
select VALUE_ from ACTIVITI.ACT_GE_PROPERTY where NAME_ = 'schema.version'
-> "5.14" is returned

- then "isEngineTablePresent()" is called which calles "isTablePresent()"
This code is executed:
tables = databaseMetaData.getTables(this.connectionMetadataDefaultCatalog, schema, tableName, JDBC_METADATA_TABLE_TYPES);

In my case this looks like this:
tables = databaseMetaData.getTables(null, "ACTIVITI", "ACTIVITI.ACT_RU_EXECUTION", JDBC_METADATA_TABLE_TYPES);

-> In Oracle 11 this does not work! The tables are not returned!
It should look like this:
tables = databaseMetaData.getTables(null, "ACTIVITI", "ACT_RU_EXECUTION", JDBC_METADATA_TABLE_TYPES);
The tableName parameter must not include the schema name!


So I the table perfix must be set to get the version in "getDbVersion()" but it must not be be set in "getTables(…)"

How can I fix this?

Another question:
Why is it necessary to check the DB every time the engine is created?
Could you implement a flag to configure if the check should be performed?

Thanks for you help!

Rolf






3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
If you set the flag to "false", the minimal checking will be performed (table exists and right version). To circumvent this (eg. you use a manual process to create/update tables), you can set it to ANY value different from "true", "false", "create", …

Eg. if you use the setDatabaseSchemaUpdate("none"), nothing will be done. This is offcourse, an undocumented feature, as it's always safer to have it set to false, to ensure engine boots on a correct engine version. Offcourse, if this doensn't work as expected in the targeted database, this is a good workaround.

rolf
Champ in-the-making
Champ in-the-making
We check the database after running the update scripts. So we do not need to check each time the engine starts.

Thanks for your help!

frederikherema1
Star Contributor
Star Contributor
Okay, so setting that property is perfectly fine for your usecase.