cancel
Showing results for 
Search instead for 
Did you mean: 

5.10->5.12 db schema migration problem

pgadecki
Champ in-the-making
Champ in-the-making
It seems that there is a problem when trying to start activiti-engine:5.12 on Oracle database with activiti:5.10 tables and schema update policy set to: ProcessEngineConfigurationImpl.DB_SCHEMA_UPDATE_DROP_CREATE

I think that it might try to perform drop for 5.12 and it fails, then while creating tables we're getting errors as tables were not dropped.
It works with schema update policy set to UPDATE.


10:51:41,084 ERROR [DbSqlSession] problem during schema drop, statement drop index ACT_IDX_MODEL_SOURCE
10:51:41,087 ERROR [DbSqlSession] problem during schema drop, statement drop index ACT_IDX_MODEL_SOURCE_EXTRA
10:51:41,089 ERROR [DbSqlSession] problem during schema drop, statement drop index ACT_IDX_MODEL_DEPLOYMENT
10:51:41,515 ERROR [DbSqlSession] problem during schema drop, statement alter table ACT_RU_EXECUTION
drop CONSTRAINT ACT_FK_EXE_PROCDEF
10:51:41,607 WARN  [loggerI18N] [com.arjuna.ats.internal.jta.recovery.xarecovery1] Local XARecoveryModule.xaRecovery  got XA exception javax.transaction.xa.XAException, XAException.XAER_RMERR
10:51:41,877 ERROR [DbSqlSession] problem during schema drop, statement alter table ACT_RE_MODEL
drop CONSTRAINT ACT_FK_MODEL_SOURCE
10:51:41,879 ERROR [DbSqlSession] problem during schema drop, statement alter table ACT_RE_MODEL
drop CONSTRAINT ACT_FK_MODEL_SOURCE_EXTRA
10:51:41,881 ERROR [DbSqlSession] problem during schema drop, statement alter table ACT_RE_MODEL
drop CONSTRAINT ACT_FK_MODEL_DEPLOYMENT
10:51:42,185 ERROR [DbSqlSession] problem during schema drop, statement drop table  ACT_RE_MODEL
10:51:42,589 INFO  [DbSqlSession] performing create on engine with resource org/activiti/db/create/activiti.oracle.create.engine.sql
10:51:45,426 INFO  [DbSqlSession] performing create on history with resource org/activiti/db/create/activiti.oracle.create.history.sql
10:51:45,428 ERROR [DbSqlSession] problem during schema create, statement create table ACT_HI_PROCINST (
ID_ NVARCHAR2(64) not null,
PROC_INST_ID_ NVARCHAR2(64) not null,
BUSINESS_KEY_ NVARCHAR2(255),
PROC_DEF_ID_ NVARCHAR2(64) not null,
START_TIME_ TIMESTAMP(6) not null,
END_TIME_ TIMESTAMP(6),
DURATION_ NUMBER(19,0),
START_USER_ID_ NVARCHAR2(255),
START_ACT_ID_ NVARCHAR2(255),
END_ACT_ID_ NVARCHAR2(255),
SUPER_PROCESS_INSTANCE_ID_ NVARCHAR2(64),
DELETE_REASON_ NVARCHAR2(2000),
primary key (ID_),
unique (PROC_INST_ID_)
)
10:51:45,431 ERROR [DbSqlSession] problem during schema create, statement create table ACT_HI_ACTINST (
ID_ NVARCHAR2(64) not null,
PROC_DEF_ID_ NVARCHAR2(64) not null,
PROC_INST_ID_ NVARCHAR2(64) not null,
EXECUTION_ID_ NVARCHAR2(64) not null,
ACT_ID_ NVARCHAR2(255) not null,
TASK_ID_ NVARCHAR2(64),
CALL_PROC_INST_ID_ NVARCHAR2(64),
ACT_NAME_ NVARCHAR2(255),
ACT_TYPE_ NVARCHAR2(255) not null,
ASSIGNEE_ NVARCHAR2(64),
START_TIME_ TIMESTAMP(6) not null,
END_TIME_ TIMESTAMP(6),
DURATION_ NUMBER(19,0),
primary key (ID_)
)
10:51:45,433 ERROR [DbSqlSession] problem during schema create, statement create table ACT_HI_TASKINST (
ID_ NVARCHAR2(64) not null,
PROC_DEF_ID_ NVARCHAR2(64),
TASK_DEF_KEY_ NVARCHAR2(255),
PROC_INST_ID_ NVARCHAR2(64),
EXECUTION_ID_ NVARCHAR2(64),
PARENT_TASK_ID_ NVARCHAR2(64),
NAME_ NVARCHAR2(255),
DESCRIPTION_ NVARCHAR2(2000),
OWNER_ NVARCHAR2(255),
ASSIGNEE_ NVARCHAR2(255),
START_TIME_ TIMESTAMP(6) not null,
CLAIM_TIME_ TIMESTAMP(6),
END_TIME_ TIMESTAMP(6),
DURATION_ NUMBER(19,0),
DELETE_REASON_ NVARCHAR2(2000),
PRIORITY_ INTEGER,
DUE_DATE_ TIMESTAMP(6),
FORM_KEY_ NVARCHAR2(255),
primary key (ID_)
)
10:51:45,596 ERROR [DbSqlSession] problem during schema create, statement create table ACT_HI_DETAIL (
ID_ NVARCHAR2(64) not null,
TYPE_ NVARCHAR2(255) not null,
PROC_INST_ID_ NVARCHAR2(64),
EXECUTION_ID_ NVARCHAR2(64),
TASK_ID_ NVARCHAR2(64),
ACT_INST_ID_ NVARCHAR2(64),
NAME_ NVARCHAR2(255) not null,
VAR_TYPE_ NVARCHAR2(64),
REV_ INTEGER,
TIME_ TIMESTAMP(6) not null,
BYTEARRAY_ID_ NVARCHAR2(64),
DOUBLE_ NUMBER(*,10),
LONG_ NUMBER(19,0),
TEXT_ NVARCHAR2(2000),
TEXT2_ NVARCHAR2(2000),
primary key (ID_)
)
10:51:45,599 ERROR [DbSqlSession] problem during schema create, statement create table ACT_HI_COMMENT (
ID_ NVARCHAR2(64) not null,
TYPE_ NVARCHAR2(255),
TIME_ TIMESTAMP(6) not null,
USER_ID_ NVARCHAR2(255),
TASK_ID_ NVARCHAR2(64),
PROC_INST_ID_ NVARCHAR2(64),
ACTION_ NVARCHAR2(255),
MESSAGE_ NVARCHAR2(2000),
FULL_MSG_ BLOB,
primary key (ID_)
)
10:51:45,601 ERROR [DbSqlSession] problem during schema create, statement create table ACT_HI_ATTACHMENT (
ID_ NVARCHAR2(64) not null,
REV_ INTEGER,
USER_ID_ NVARCHAR2(255),
NAME_ NVARCHAR2(255),
DESCRIPTION_ NVARCHAR2(2000),
TYPE_ NVARCHAR2(255),
TASK_ID_ NVARCHAR2(64),
PROC_INST_ID_ NVARCHAR2(64),
URL_ NVARCHAR2(2000),
CONTENT_ID_ NVARCHAR2(64),
primary key (ID_)
)
10:51:45,606 ERROR [DbSqlSession] problem during schema create, statement create index ACT_IDX_HI_PRO_INST_END on ACT_HI_PROCINST(END_TIME_)
10:51:45,608 ERROR [DbSqlSession] problem during schema create, statement create index ACT_IDX_HI_PRO_I_BUSKEY on ACT_HI_PROCINST(BUSINESS_KEY_)
10:51:45,611 ERROR [DbSqlSession] problem during schema create, statement create index ACT_IDX_HI_ACT_INST_START on ACT_HI_ACTINST(START_TIME_)
10:51:45,613 ERROR [DbSqlSession] problem during schema create, statement create index ACT_IDX_HI_ACT_INST_END on ACT_HI_ACTINST(END_TIME_)
10:51:45,617 ERROR [DbSqlSession] problem during schema create, statement create index ACT_IDX_HI_DETAIL_PROC_INST on ACT_HI_DETAIL(PROC_INST_ID_)
10:51:45,619 ERROR [DbSqlSession] problem during schema create, statement create index ACT_IDX_HI_DETAIL_ACT_INST on ACT_HI_DETAIL(ACT_INST_ID_)
10:51:45,622 ERROR [DbSqlSession] problem during schema create, statement create index ACT_IDX_HI_DETAIL_TIME on ACT_HI_DETAIL(TIME_)
10:51:45,624 ERROR [DbSqlSession] problem during schema create, statement create index ACT_IDX_HI_DETAIL_NAME on ACT_HI_DETAIL(NAME_)
10:51:45,626 ERROR [DbSqlSession] problem during schema create, statement create index ACT_IDX_HI_DETAIL_TASK_ID on ACT_HI_DETAIL(TASK_ID_)
10:51:45,799 ERROR [DbSqlSession] problem during schema create, statement create unique index ACT_UNIQ_HI_BUS_KEY on ACT_HI_PROCINST
(case when BUSINESS_KEY_ is null then null else PROC_DEF_ID_ end,
case when BUSINESS_KEY_ is null then null else BUSINESS_KEY_ end)
10:51:45,990 ERROR [CommandContext] Error while closing command context
org.activiti.engine.ActivitiException: couldn't create db schema: create table ACT_HI_PROCINST (
ID_ NVARCHAR2(64) not null,
PROC_INST_ID_ NVARCHAR2(64) not null,
BUSINESS_KEY_ NVARCHAR2(255),
PROC_DEF_ID_ NVARCHAR2(64) not null,
START_TIME_ TIMESTAMP(6) not null,
END_TIME_ TIMESTAMP(6),
DURATION_ NUMBER(19,0),
START_USER_ID_ NVARCHAR2(255),
START_ACT_ID_ NVARCHAR2(255),
END_ACT_ID_ NVARCHAR2(255),
SUPER_PROCESS_INSTANCE_ID_ NVARCHAR2(64),
DELETE_REASON_ NVARCHAR2(2000),
primary key (ID_),
unique (PROC_INST_ID_)
)
   at org.activiti.engine.impl.db.DbSqlSession.executeSchemaResource(DbSqlSession.java:1055)
   at org.activiti.engine.impl.db.DbSqlSession.executeSchemaResource(DbSqlSession.java:980)
   at org.activiti.engine.impl.db.DbSqlSession.executeMandatorySchemaResource(DbSqlSession.java:797)
   at org.activiti.engine.impl.db.DbSqlSession.dbSchemaCreateHistory(DbSqlSession.java:770)
   at org.activiti.engine.impl.db.DbSqlSession.dbSchemaCreate(DbSqlSession.java:757)
   at org.activiti.engine.impl.db.DbSqlSession.performSchemaOperationsProcessEngineBuild(DbSqlSession.java:1108)
   at org.activiti.engine.impl.SchemaOperationsProcessEngineBuild.execute(SchemaOperationsProcessEngineBuild.java:25)
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:61)
   at org.activiti.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:60)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
   at org.activiti.engine.impl.ProcessEngineImpl.<init>(ProcessEngineImpl.java:76)
   
Caused by: java.sql.SQLSyntaxErrorException: ORA-00955: Es gibt bereits ein Objekt mit diesem Namen

   at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
   at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
   at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
   at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
   at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
   at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
   at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:194)
   at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:1000)
   at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1307)
   at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1882)
   at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1847)
   at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:301)
   at org.jboss.resource.adapter.jdbc.WrappedStatement.execute(WrappedStatement.java:91)
   at org.activiti.engine.impl.db.DbSqlSession.executeSchemaResource(DbSqlSession.java:1029)
   … 73 more
10:51:45,993 INFO  [ScopedProcessEngineManager] Activiti service  failed to initialize, see above.
5 REPLIES 5

groopk
Champ in-the-making
Champ in-the-making
Not to hijack your thread, but to add on to it, we get the following going from 5.11 to 5.12:


org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "ACT_FK_I
DL_PROCINST: PUBLIC.ACT_RU_IDENTITYLINK FOREIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('2713')"; SQ
L statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-169]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
        ….
### The error may involve org.activiti.engine.impl.persistence.entity.ExecutionEntity.deleteExecution-Inline
### The error occurred while setting parameters
### SQL: delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ?
### Cause: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "ACT_FK_IDL_PROCINST: PUBLIC.ACT_RU
_IDENTITYLINK FOREIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('2713')"; SQL statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-169]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
        ….
Caused by: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "ACT_FK_IDL_PROCINST: PUBLIC.ACT_RU
_IDENTITYLINK FOREIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('2713')"; SQL statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-169]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
        ….
Exception in thread "Thread-3" org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "ACT_FK_I
DL_PROCINST: PUBLIC.ACT_RU_IDENTITYLINK FOREIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('2713')"; SQ
L statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-169]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
        ….
### The error may involve org.activiti.engine.impl.persistence.entity.ExecutionEntity.deleteExecution-Inline
### The error occurred while setting parameters
### SQL: delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ?
### Cause: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "ACT_FK_IDL_PROCINST: PUBLIC.ACT_RU
_IDENTITYLINK FOREIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('2713')"; SQL statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-169]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
        …
Caused by: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "ACT_FK_IDL_PROCINST: PUBLIC.ACT_RU
_IDENTITYLINK FOREIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('2713')"; SQL statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-169]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)


Not too big of a deal for us, we can just wipe the DB and start over, we are still in development mode. but FYI.

pgadecki
Champ in-the-making
Champ in-the-making
Not too big of a deal for us, we can just wipe the DB and start over, we are still in development mode. but FYI.

Yeah, same story here, but it's still a problem.

jbarrez
Star Contributor
Star Contributor
@pgadecki: so am I understanding you correctly: the create should never have started if the drop didn't succeed? And that is exactly what DOES happen now?

@ groopk: when do you see this error? Do you have a simple test case that can demonstrate the problem?

pgadecki
Champ in-the-making
Champ in-the-making
@pgadecki: so am I understanding you correctly: the create should never have started if the drop didn't succeed? And that is exactly what DOES happen now?
What is important is the reason why drop didn't succeed (I'm guessing that it's beceause it was executing a drop sql for 5.12 not for 5.10 on 5.10 schema, correct me if I'm wrong). As long as ACT_GE_PROPERTY keeps current activiti db schema.version this value could be used to select proper drop sql file version.

jbarrez
Star Contributor
Star Contributor
That's a valid point.  However, most database don't offer transactions for DDL (which would simplify things ENORMOUSLY), and you can't be sure what has been dropped/created. So resetteing the version would also be kinda wrong, as you are probably somewhere 'in between' versions.