AnsweredAssumed Answered

Problem with DB2 Support in 5.4

Question asked by saatsch on Apr 8, 2011
Latest reply on Apr 11, 2011 by frederikheremans1
Hey all !

when running
ant db.create

I got the following Error:

     [java] org.activiti.engine.ActivitiException: couldn't deduct database type from database product name 'DB2/LINUXZ64'
     [java]     at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initDatabaseType(ProcessEngineConfigurationImpl.java:432)
     [java]     at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initDataSource(ProcessEngineConfigurationImpl.java:390)
     [java]     at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:259)
     [java]     at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:236)
     [java]     at org.activiti.engine.ProcessEngines.buildProcessEngine(ProcessEngines.java:177)
     [java]     at org.activiti.engine.ProcessEngines.initProcessEnginFromResource(ProcessEngines.java:150)
     [java]     at org.activiti.engine.ProcessEngines.init(ProcessEngines.java:88)
     [java]     at org.activiti.engine.ProcessEngines.getProcessEngine(ProcessEngines.java:207)
     [java]     at org.activiti.engine.ProcessEngines.getDefaultProcessEngine(ProcessEngines.java:200)
     [java]     at org.activiti.engine.impl.db.DbSchemaUpdate.main(DbSchemaUpdate.java:34)

I think you should add this database type to the databaseTypeMappings here: http://svn.codehaus.org/activiti/activiti/trunk/modules/activiti-engine/src/main/java/org/activiti/engine/impl/cfg/ProcessEngineConfigurationImpl.java

Anyway, after some hacking, I got it to work.
But I think I have found a bug here:
http://svn.codehaus.org/activiti/activiti/trunk/modules/activiti-engine/src/main/resources/org/activiti/db/create/activiti.db2.create.identity.sql

where it says:
create table ACT_ID_INFO (
    ID_ varchar(64),
    REV_ integer,
    USER_ID_ varchar(64),
    TYPE_ varchar(64),
    KEY_ varchar(255),
    VALUE_ varchar(255),
    PASSWORD_ BLOB,
    PARENT_ID_ varchar(255),
    primary key (ID_)
);

You should declare the column ID_ with NOT NULL, because DB2 cannot have a column in the primary key, where null values are allowed. See also http://www.google.com/search?q=SQL0542N

Greets, and keep up the good work !
Saatsch

Outcomes