JTA Atomikos and JBPM Deadlock

Solution for JTA Atomikos and JBPM Deadlock
is Given Below:

The scenario:

  1. Thread 1 will do a command get task, they lock the runtime engine and doing getTask
07:29:05.875 [http-nio-8080-exec-1] DEBUG o.j.r.m.i.PerProcessInstanceRuntimeManager - Trying to get a lock [email protected][Unlocked] for or[email protected]11ae246a by [email protected]
07:29:05.875 [http-nio-8080-exec-1] DEBUG o.j.r.m.i.PerProcessInstanceRuntimeManager - Lock [email protected][Locked by thread http-nio-8080-exec-1] taken for or[email protected]11ae246a by [email protected] for waiting threads by false
07:29:05.876 [http-nio-8080-exec-1] DEBUG o.j.s.t.p.TaskTransactionInterceptor - Instantiating KieSpringTransactionManager
  1. After finish the task, they’re still locking the runtime engine
  2. Making a request to do another task, the application tries to get the lock
07:30:22.224 [http-nio-8080-exec-5] DEBUG o.j.r.m.i.DefaultRuntimeEnvironment - Unable to find on initialize ejb schduler service due to org.jbpm.services.ejb.timer.EjbSchedulerService
07:30:22.272 [http-nio-8080-exec-5] DEBUG o.j.r.m.i.PerProcessInstanceRuntimeManager - Trying to get a lock [email protected][Locked by thread http-nio-8080-exec-1] for or[email protected]16bd5ad7 by [email protected]

At this step, they will be waiting to timeout for getting the lock.

My question is how the lock could not be released after step 1.