Custom task blocks the JobQueue processing

Hello group!

Note: OneIM version: 9.3, the issue only appears in the Fat Manager client.

We have developed a custom task that is shown only for deactivated external identities and inside the MethodScript field, there is a call to a sub (CCC_Reactivate_Identity) that performs the following steps

1. Sets the permanently de-activated flag to false and Extends the exit date of the current Identity 14 days.

..........

    dbPerson.PutValue("isInactive", 0)

    dbPerson.PutValue("exitdate", DateTime.Now.AddDays(14))

    dbPerson.Save(Session)

.........

3. Reads all the accounts from the UNSAccount table and for each one of them, run the recall method.

4. Creates a new Attestation.

5. Pops up a message "Task complete" if everything went well.

6. Pops up a message "Task completed with ERROR" (Exceptions are handled in order to customize the error messages)

We have noticed, that if the end user does not click on the last pop up, the jobqueue gets blocked by the manager of the end user.

We have tried:

1. Change the behavior of the task to "Save required". This could be the solution and works fine if the re-activation works correctly, but if there is any error, for example saving the dbPerson object, then after clicking on the OK button in the error pop up, the manager crashes and it needs to be restarted.

Checking the logs appears this error:

 ---> VI.Base.ViException: Trying to run SQL command in canceled transaction

Any idea what are we doing wrong?

Kind regards,

David.