I'm using a taskService.createTaskQuery().taskId(taskId) to get the task with the specified taskId it works sometimes but the most of the time it returns NULL.
in my code i'm using also taskService.createTaskQuery().processInstanceId(processInst.getId()).list(); and it works perfectly after setting "async" property to false.