AnsweredAssumed Answered

Activiti/PostgreSQL startup issue

Question asked by abandarupalli on Dec 19, 2017

We used to work with MariaDB and Activiti earlier and had to migrate to PostgreSQL. We have let the application initialize the database i.e create Activit database tables. We have activiti engine(jar) bundled within our application.

 

We didn't see issues with MariaDB, but when we switched to PostgresSQL the application startup is failing unable to read from database tables.

 

### Error querying database.  Cause: org.postgresql.util.PSQLException: ERROR: relation "act_ge_property" does not exist

  Position: 15

### The error may exist in org/activiti/db/mapping/entity/Property.xml

### The error may involve org.activiti.engine.impl.persistence.entity.PropertyEntityImpl.selectProperty-Inline

### The error occurred while setting parameters

### SQL: select * from ACT_GE_PROPERTY where NAME_ = ?

### Cause: org.postgresql.util.PSQLException: ERROR: relation "act_ge_property" does not exist

  Position: 15

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[mybatis-3.4.2.jar!/:3.4.2]

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150) ~[mybatis-3.4.2.jar!/:3.4.2]

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) ~[mybatis-3.4.2.jar!/:3.4.2]

at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77) ~[mybatis-3.4.2.jar!/:3.4.2]

at org.activiti.engine.impl.db.DbSqlSession.selectById(DbSqlSession.java:364) ~[activiti-engine-6.0.0.jar!/:6.0.0]

at org.activiti.engine.impl.persistence.entity.data.AbstractDataManager.findById(AbstractDataManager.java:66) ~[activiti-engine-6.0.0.jar!/:6.0.0]

at org.activiti.engine.impl.persistence.entity.AbstractEntityManager.findById(AbstractEntityManager.java:39) ~[activiti-engine-6.0.0.jar!/:6.0.0]

at org.activiti.engine.impl.cmd.ValidateExecutionRelatedEntityCountCfgCmd.execute(ValidateExecutionRelatedEntityCountCfgCmd.java:54) ~[activiti-engine-6.0.0.jar!/:6.0.0]

 

Looks like the DB initializer is not able to read the created database tables. The issue is gone when datasource autocommit is changed to 'true'. But ideally, we don't want to have autocommit=true as the same datasource is used for transactions. 

 

Anyone faced this issue in the past?

Also is it a normal practice to application create database tables on first time installation?

 

Outcomes