droolsjbpm/jbpm — pull request #151 by mswiderski (2013-01-30 17:47:30+00:00)
Title: JBPM-3882 - Clean Tasks from DBMS when a Process is cancelled

as the main purpose of this pull request is to fix task clean up event listener but as part of that fix changes to LocalTaskService were added to make sure that it will open task service session per method call which should make it thread safe(r).
Important note is that LocalTaskService should always be executed with JTA transaction to ensure that both runtime engine and task service will share persistence context.