01-13-2012 12:15 PM
…
CommandContext commandContext = Context.getCommandContext();
List<TaskEntity> tasks = (List) new TaskQueryImpl(commandContext)
.executionId(id)
.list();
for (TaskEntity task : tasks) {
if (replacedBy!=null) {
task.setExecution(replacedBy);
} else {
commandContext
.getTaskManager()
.deleteTask(task, TaskEntity.DELETE_REASON_DELETED, false);
}
}
List<Job> jobs = new JobQueryImpl(commandContext)
.executionId(id)
.list();
for (Job job: jobs) {
if (replacedBy!=null) {
((JobEntity)job).setExecution((ExecutionEntity) replacedBy);
} else {
((JobEntity)job).delete();
}
}
…
For our tests we changed the creation of the two dynamic queries to static queries (since the dynamic queries always evaluate to the same SELECT statement anyway). This change led to a performance increase of up to 100% in our tests.
<select id="selectJobsByExecutionId" parameterType="string" resultMap="jobResultMap">
select *
from ACT_RU_JOB J
where J.EXECUTION_ID_ = #{executionId}
</select>
Note also the following quote from http://forums.activiti.org/en/viewtopic.php?f=6&t=1523#p6386 about the queries in ExecutionEntity.remove():Profiler shows that they consume at least 50-70% of overall time.We created a Jira issue (ACT-1056) and can contribute a patch if needed.
01-30-2012 09:40 AM
01-31-2012 07:18 AM
02-02-2012 08:51 AM
02-03-2012 03:45 AM
03-06-2012 08:09 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.