I make a lot of try starting several processes and it's seems to be totally randomly. Sometimes the process is created and then the task is also created and persist, and most of the time the process is created but not the task.
It's very hard to debug because there is no error anywhere. The problem seems to appeared where I start using
ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId, kbase, null, env);
and I also add the method for dispose the ksession in the same time.