Error while MessageCorrelation end

In this example, in the SendEmail class, adding an arbitrary value to the process variable will cause an FK exception

Compensation of Multi-Instance Subprocess (Example)

error stackTrace :
Cannot delete or update a parent row: a foreign key constraint fails (soms_flow_test.act_ru_variable, CONSTRAINT ACT_FK_VAR_EXE FOREIGN KEY (EXECUTION_ID_) REFERENCES act_ru_execution (ID_))
DbOperation :
0 = {DbEntityOperation@46747} “INSERT HistoricActivityInstanceEventEntity[Activity_1rm0djj:e26f07df-a758-11eb-8285-00232481f771]”
1 = {DbEntityOperation@46748} “INSERT HistoricActivityInstanceEventEntity[EndEvent_0x6ir2l:98dfcf41-a762-11eb-8285-00232481f771]”
2 = {DbEntityOperation@46749} “INSERT HistoricActivityInstanceEventEntity[Event_0dgdyn1:d362419f-a756-11eb-8285-00232481f771]”
3 = {DbEntityOperation@46750} “INSERT HistoricActivityInstanceEventEntity[Event_0l1dgjz:a6e22241-a74d-11eb-8285-00232481f771]”
4 = {DbEntityOperation@46751} “INSERT HistoricActivityInstanceEventEntity[Event_0mump3v:bb3e4000-a760-11eb-8285-00232481f771]”
5 = {DbEntityOperation@46752} “INSERT HistoricActivityInstanceEventEntity[Event_1949htx:554a5eed-a758-11eb-8285-00232481f771]”
6 = {DbEntityOperation@46753} “INSERT HistoricActivityInstanceEventEntity[Event_1h0rlom:eb3068f6-a751-11eb-8285-00232481f771]”
7 = {DbEntityOperation@46754} “DELETE EventSubscriptionEntity[797191d7-a745-11eb-8285-00232481f771]”
8 = {DbEntityOperation@46755} “DELETE EventSubscriptionEntity[79a7bd14-a745-11eb-8285-00232481f771]”
9 = {DbEntityOperation@46756} “DELETE EventSubscriptionEntity[79a8a778-a745-11eb-8285-00232481f771]”
10 = {DbEntityOperation@46757} “DELETE TaskEntity[79a80b36-a745-11eb-8285-00232481f771]”
11 = {DbEntityOperation@46758} “DELETE ExecutionEntity[7972552c-a745-11eb-8285-00232481f771]”
12 = {DbEntityOperation@46759} “DELETE ExecutionEntity[79a8a777-a745-11eb-8285-00232481f771]”
13 = {DbEntityOperation@46760} “DELETE ExecutionEntity[7972552d-a745-11eb-8285-00232481f771]”
14 = {DbEntityOperation@46761} “DELETE ExecutionEntity[79722e19-a745-11eb-8285-00232481f771]”
15 = {DbEntityOperation@46762} “DELETE ExecutionEntity[797191d6-a745-11eb-8285-00232481f771]”
16 = {DbEntityOperation@46763} “DELETE ExecutionEntity[797143b4-a745-11eb-8285-00232481f771]”
17 = {DbEntityOperation@46764} “UPDATE HistoricActivityInstanceEventEntity[Activity_0u3ynln:79a7e425-a745-11eb-8285-00232481f771]”
18 = {DbEntityOperation@46765} “UPDATE HistoricActivityInstanceEventEntity[Event_1vmiqa4:79a8a779-a745-11eb-8285-00232481f771]”
19 = {DbEntityOperation@46766} “UPDATE HistoricActivityInstanceEventEntity[say-hello:797191d8-a745-11eb-8285-00232481f771]”
20 = {DbEntityOperation@46767} “UPDATE HistoricProcessInstanceEventEntity[797143b4-a745-11eb-8285-00232481f771]”
21 = {DbEntityOperation@46768} “UPDATE HistoricProcessInstanceEventEntity[79722e19-a745-11eb-8285-00232481f771]”
22 = {DbEntityOperation@46769} “UPDATE HistoricTaskInstanceEventEntity[79a80b36-a745-11eb-8285-00232481f771]”

The DbOperation where the error occurred is:14 = {DbEntityOperation@46761} “DELETE ExecutionEntity[79722e19-a745-11eb-8285-00232481f771]”
sql :delete from ACT_RU_EXECUTION where ID_ = ‘79722e19-a745-11eb-8285-00232481f771’ and REV_ = 1

myflow:
process.bpmn (4.9 KB)
subprocess.bpmn (7.0 KB)

Have found the reason