I'm looking for a solution to delete variables in a bulk job. Activiti deletes at the end of a process every variable in a single delete Statement. In my case the deletion of 15 variables per process instance takes 17% of the whole db machine time.
If I delete it manual (ProcessEndListener) delete from act_ru_variables where _proc_inst = ? i've got a OptimisticLockException.