AnsweredAssumed Answered

Possible bug when using MS-SQL server configuration

Question asked by tommyalf on Mar 3, 2014
Latest reply on Mar 10, 2014 by jbarrez
Hi all,
  when I use this configuration:

<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
        <property name="dataSource" ref="dataSource"/>
        <property name="transactionManager" ref="transactionManager"/>
        <property name="databaseSchemaUpdate" value="false"/>
        <property name="databaseSchema" value="mySchema"/>
        <property name="databaseTablePrefix" value="mySchema."/>
I receive this error:
org.activiti.engine.ActivitiException: Activiti database problem: Tables missing for component(s) engine, history, identity

This is because JTDS ( it is my jdbc connector but I investigated also on SQLJDBC which it has the same behaviour)
uses 'sp_tables' system stored procedure when check Table Metadata. 'sp_tables' fails because the name of table is changed by :
tableName = prependDatabaseTablePrefix(tableName);   (isTablePresent – DbSqlSession - 766).

Use prependDatabase seems a rigth thing but in this case causes the store procededure fail.

On the contrary I can't remove "databaseTablePrefix" because activiti tables are under a not default schema for my db user.
If I remove it Activiti will be not able to find tables.