The foreign key is must be keeped ? If I delete the foreign keys, The data integrity can be Ensured,But we will get profile from insert/update/delete performance.
You’ve answered it yourself: without foreign keys, the database will not guarantee consistency. That’s a small price to pay for a mimimal impact on performance.
Thanks Joram!
When users handle one instance at the same time, SQLIntegrityConstraintViolationException will happen.
What should I do for SQLIntegrityConstraintViolationException, retry the same call ?
error log :
The error occurred while setting parameters
SQL: insert into ACT_RU_VARIABLE (ID_, REV_, TYPE_, NAME_, PROC_INST_ID_, EXECUTION_ID_, TASK_ID_, BYTEARRAY_ID_, DOUBLE_, LONG_ , TEXT_, TEXT2_) values ( ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
Cause: java.sql.SQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails ( flowable-spring-boot
. act_ru_variable
, CONSTRAINT ACT_FK_VAR_EXE
FOREIGN KEY ( EXECUTION_ID_
) REFERENCES act_ru_execution
( ID_
))
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) at