Contention in mybatis due to dynamic query creation in ExecutionEntity.remove()

Description

During performance tests on a hardware with 12 cores, we found a contention in MyBatis.
The following code snippet from ExecutionEntity.remove() shows two Queries which are created dynamically for each process instance.

ExecutionEntity.java

We found this dynamic creation (which leads always to the same SQL statements) to be a severe performance bottleneck in our tests (see also http://forums.activiti.org/en/viewtopic.php?f=6&t=1523&#p6386 for a similar observation).
We added two new static queries which just select the Tasks resp. Jobs for the ExecutionEntity and gained a performance boost (throughput) of up to 100%.

As an example the new static query for Jobs which we used instead of the original dynamic query (selectJobByQueryCriteria):

/org/activiti/db/mapping/entity/Job.xml

We could provide an according patch if needed.

Assignee

Frederik Heremans

Reporter

Christian Staege

Labels

None

Components

Fix versions

Priority

Major
Configure