cancel
Showing results for 
Search instead for 
Did you mean: 

Error updating database

lokesh_zyme
Champ in-the-making
Champ in-the-making
Hello Activity developers ,

I am using activiti 5.15  with openidm integration . I have create a workflow with some scheduler user task .and which I am completeting manually by using complete task .
in the same work flow I am using another user task that need  user approval . but I am getting following issue .

please help me in that . thanks, in advance . the error details is as follows

======================================================
Error while closing command context

### Error updating database.  Cause: org.h2.jdbc.JdbcSQLException: Referential i
ntegrity constraint violation: "ACT_FK_EXE_PROCINST: PUBLIC.ACT_RU_EXECUTION FOR
EIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('7')"; SQL stat
ement:
insert into ACT_RU_EXECUTION (ID_, REV_, PROC_INST_ID_, BUSINESS_KEY_, PROC_DEF_
ID_, ACT_ID_, IS_ACTIVE_, IS_CONCURRENT_, IS_SCOPE_,IS_EVENT_SCOPE_, PARENT_ID_,
SUPER_EXEC_, SUSPENSION_STATE_, CACHED_ENT_STATE_)
    values (
      ?,
      1,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?
    ) [23506-168]
### The error may involve org.activiti.engine.impl.persistence.entity.ExecutionE
ntity.insertExecution-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RU_EXECUTION (ID_, REV_, PROC_INST_ID_, BUSINESS_KEY_,
PROC_DEF_ID_, ACT_ID_, IS_ACTIVE_, IS_CONCURRENT_, IS_SCOPE_,IS_EVENT_SCOPE_, PA
RENT_ID_, SUPER_EXEC_, SUSPENSION_STATE_, CACHED_ENT_STATE_)     values (
?,       1,       ?,       ?,       ?,       ?,       ?,       ?,       ?,
?,       ?,       ?,       ?,       ?     )
### Cause: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violat
ion: "ACT_FK_EXE_PROCINST: PUBLIC.ACT_RU_EXECUTION FOREIGN KEY(PROC_INST_ID_) RE
FERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('7')"; SQL statement:
insert into ACT_RU_EXECUTION (ID_, REV_, PROC_INST_ID_, BUSINESS_KEY_, PROC_DEF_
ID_, ACT_ID_, IS_ACTIVE_, IS_CONCURRENT_, IS_SCOPE_,IS_EVENT_SCOPE_, PARENT_ID_,
SUPER_EXEC_, SUSPENSION_STATE_, CACHED_ENT_STATE_)
    values (
      ?,
      1,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?
    ) [23506-168]
-> org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.
java:23)
-> org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession
.java:147)
-> org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession
.java:134)
-> org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:459)
-> org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:369)
-> org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandCont
ext.java:157)
-> org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java
:109)
-> org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(Comman
dContextInterceptor.java:49)
-> org.activiti.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTra
nsactionInterceptor.java:59)
-> org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.ja
va:33)
-> org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunna
ble.java:46)
-> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:114
5)
-> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:61
5)
-> java.lang.Thread.run(Thread.java:724)
Referential integrity constraint violation: "ACT_FK_EXE_PROCINST: PUBLIC.ACT_RU_
EXECUTION FOREIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('7
')"; SQL statement:
insert into ACT_RU_EXECUTION (ID_, REV_, PROC_INST_ID_, BUSINESS_KEY_, PROC_DEF_
ID_, ACT_ID_, IS_ACTIVE_, IS_CONCURRENT_, IS_SCOPE_,IS_EVENT_SCOPE_, PARENT_ID_,
SUPER_EXEC_, SUSPENSION_STATE_, CACHED_ENT_STATE_)
    values (
      ?,
      1,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?
    ) [23506-168]
-> org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.
java:23)
-> org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession
.java:147)
-> org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession
.java:134)
-> org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:459)
-> org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:369)
-> org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandCont
ext.java:157)
-> org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java
:109)
-> org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(Comman
dContextInterceptor.java:49)
-> org.activiti.engine.impl.interceptor.JtaTransactionInterceptor.execute(JtaTra
nsactionInterceptor.java:59)
-> org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.ja
va:33)
-> org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJobsRunna
ble.java:46)
-> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:114
5)
-> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:61
5)
-> java.lang.Thread.run(Thread.java:724)Exception in thread "pool-4-thread-1" or
g.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: org.h2.jdbc.JdbcSQLException: Referential i
ntegrity constraint violation: "ACT_FK_EXE_PROCINST: PUBLIC.ACT_RU_EXECUTION FOR
EIGN KEY(PROC_INST_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('7')"; SQL stat
ement:
insert into ACT_RU_EXECUTION (ID_, REV_, PROC_INST_ID_, BUSINESS_KEY_, PROC_DEF_
ID_, ACT_ID_, IS_ACTIVE_, IS_CONCURRENT_, IS_SCOPE_,IS_EVENT_SCOPE_, PARENT_ID_,
SUPER_EXEC_, SUSPENSION_STATE_, CACHED_ENT_STATE_)
    values (
      ?,
      1,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?
    ) [23506-168]
### The error may involve org.activiti.engine.impl.persistence.entity.ExecutionE
ntity.insertExecution-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RU_EXECUTION (ID_, REV_, PROC_INST_ID_, BUSINESS_KEY_,
PROC_DEF_ID_, ACT_ID_, IS_ACTIVE_, IS_CONCURRENT_, IS_SCOPE_,IS_EVENT_SCOPE_, PA
RENT_ID_, SUPER_EXEC_, SUSPENSION_STATE_, CACHED_ENT_STATE_)     values (
?,       1,       ?,       ?,       ?,       ?,       ?,       ?,       ?,
?,       ?,       ?,       ?,       ?     )
### Cause: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violat
ion: "ACT_FK_EXE_PROCINST: PUBLIC.ACT_RU_EXECUTION FOREIGN KEY(PROC_INST_ID_) RE
FERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('7')"; SQL statement:
insert into ACT_RU_EXECUTION (ID_, REV_, PROC_INST_ID_, BUSINESS_KEY_, PROC_DEF_
ID_, ACT_ID_, IS_ACTIVE_, IS_CONCURRENT_, IS_SCOPE_,IS_EVENT_SCOPE_, PARENT_ID_,
SUPER_EXEC_, SUSPENSION_STATE_, CACHED_ENT_STATE_)
    values (
      ?,
      1,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?
    ) [23506-168]
        at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(Exception
Factory.java:23)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSq
lSession.java:147)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSq
lSession.java:134)
        at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.ja
va:459)
        at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:369)

        at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(Com
mandContext.java:157)
        at org.activiti.engine.impl.interceptor.CommandContext.close(CommandCont
ext.java:109)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execut
e(CommandContextInterceptor.java:49)
        at org.activiti.engine.impl.interceptor.JtaTransactionInterceptor.execut
e(JtaTransactionInterceptor.java:59)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterc
eptor.java:33)
        at org.activiti.engine.impl.jobexecutor.ExecuteJobsRunnable.run(ExecuteJ
obsRunnable.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:615)
        at java.lang.Thread.run(Thread.java:724)
Caused by: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violat
ion: "ACT_FK_EXE_PROCINST: PUBLIC.ACT_RU_EXECUTION FOREIGN KEY(PROC_INST_ID_) RE
FERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('7')"; SQL statement:
insert into ACT_RU_EXECUTION (ID_, REV_, PROC_INST_ID_, BUSINESS_KEY_, PROC_DEF_
ID_, ACT_ID_, IS_ACTIVE_, IS_CONCURRENT_, IS_SCOPE_,IS_EVENT_SCOPE_, PARENT_ID_,
SUPER_EXEC_, SUSPENSION_STATE_, CACHED_ENT_STATE_)
    values (
      ?,
      1,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?,
      ?
    ) [23506-168]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
        at org.h2.message.DbException.get(DbException.java:169)
        at org.h2.message.DbException.get(DbException.java:146)
        at org.h2.constraint.ConstraintReferential.checkRowOwnTable(ConstraintRe
ferential.java:361)
        at org.h2.constraint.ConstraintReferential.checkRow(ConstraintReferentia
l.java:303)
        at org.h2.table.Table.fireConstraints(Table.java:871)
        at org.h2.table.Table.fireAfterRow(Table.java:888)
        at org.h2.command.dml.Insert.insertRows(Insert.java:126)
        at org.h2.command.dml.Insert.update(Insert.java:84)
        at org.h2.command.CommandContainer.update(CommandContainer.java:75)
        at org.h2.command.Command.executeUpdate(Command.java:230)
        at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:
194)
        at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(
PreparedStatementHandler.java:41)
        at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(R
outingStatementHandler.java:66)
        at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.jav
a:45)
        at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:108)

        at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.jav
a:75)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSq
lSession.java:145)
        … 12 more
3 REPLIES 3

jbarrez
Star Contributor
Star Contributor
That's not enough info for us to know what you are trying to do … what bit of code makes this exception happen?

lokesh_zyme
Champ in-the-making
Champ in-the-making
This is my Work flow code with simple requirment .

<process id="Add_Business_Registration_sample" name="Add Business and User registration"
  isExecutable="true">
  <startEvent id="start" activiti:initiator="startUserId">
   <extensionElements>

   </extensionElements>
  </startEvent>
  <userTask id="claimbusiness" name="Claim Business"
   activiti:candidateUsers="openidm-admin" activiti:assignee="openidm-admin">  
  </userTask>
  <sequenceFlow sourceRef="start" targetRef="verify_listing_approval" />
  <boundaryEvent id="verify_listing_approval" name="Timer" attachedToRef="claimbusiness" cancelActivity="false">
       <timerEventDefinition>
       <timeCycle>0/10 * * * * ?</timeCycle>
     </timerEventDefinition>
        </boundaryEvent>
  <!– create Business @returns request Id –>
  <sequenceFlow sourceRef="verify_listing_approval" targetRef="createbusiness" />
  <scriptTask id="createbusiness" scriptFormat="groovy">
   <script>
    outSmiley Tonguerintln "\n ===========WORKFLOW STARTED=================AB-CREATE BUSINESS TASK:"
   </script>
  </scriptTask>
  <sequenceFlow sourceRef="createbusiness" targetRef="end" />
  <endEvent id="end" />
</process>

I used cron trigger .. I wanted to run cron trigger fro start date to 3 months . after that I want to stop that cron trigger .

how can I do that ??

jbarrez
Star Contributor
Star Contributor
The forum has messed up your XML. Put your xml between 'code' brackets ie <  code  > without the spaces.

One way to implement your requirement is that you use an intermidate catching timer event, where you do the date calculation yourself each time, and loop back to the timer until the date where you want to stop is reached.