AnsweredAssumed Answered

Referential integrity constraint violation

Question asked by fbrcls on Oct 27, 2014
Latest reply on Mar 10, 2016 by johnm

I receive the following exception during my process execution:

### Error updating database.  Cause: org.h2.jdbc.JdbcSQLException: Referential integrity constraint violation: "ACT_FK_VAR_BYTEARRAY: PUBLIC.ACT_RU_VARIABLE FOREIGN KEY(BYTEARRAY_ID_) REFERENCES PUBLIC.ACT_GE_BYTEARRAY(ID_) ('20')"; SQL statement:

In attachment the process definition.

The process execution is the following: first we come in the service task "findTaxFile" that assigns "null" to the process variable "taxFile". After that we come in another service task "createTaxFile" that assigns a not null value to the same process variable "taxFile". All these task are synchronous. And finally we come to a manual asynchronous task "communicateTurnoverRequest". The error happens when activiti tries to commit the transaction before the manual task.

When I define the "createTaxFile" as asynchronous, the error doesn't happen anymore.

Is this a bug in Activiti of a misuse of the engine?

Thanks for your help.