JBoss Community

Re: Multiple Sessions - Timer Tasks - some triggered twice and some missed

created by tmag in jBPM - View the full discussion

Seems there are multiple problems - for repeating timer tasks in regular intervals.

 

1. Sometimes multiple instances of ScheduledThreadPool objects getting created on single session - which we tried to avoid by making scheduler static as above.

2. ProcessContext data getting corrupted with duplicate process instance info.

When we print out the session & process info from context  in our registered custom timer service  - its showing duplicate process instance ids as shown below.

 

ProcessJobContext processJobContext = (ProcessJobContext) ctx;

StatefulKnowledgeSessionImpl ksessionImpl = (StatefulKnowledgeSessionImpl) processJobContext.getKnowledgeRuntime();

System.out.println("**********>session id : "+ ksessionImpl.getId() + "; process id : "+ processJobContext.getProcessInstanceId());

 

 

**********> session id : 0; process id : 6

**********> session id : 0; process id : 7

**********> session id : 0; process id : 8

**********> session id : 0; process id : 9

**********> session id : 0; process id : 10

......................

 

**********> session id : 0; process id : 6

**********> session id : 0; process id : 7

**********> session id : 0; process id : 8

**********> session id : 0; process id : 9

**********> session id : 0; process id : 10

 

These processes 6 to 10 are getting scheduled twice & executing twice.

Reply to this message by going to Community

Start a new discussion in jBPM at Community