tmag [
https://community.jboss.org/people/tmag] created the discussion
"Re: Multiple Sessions - Timer Tasks - some triggered twice and some missed"
To view the discussion, visit:
https://community.jboss.org/message/793026#793026
--------------------------------------------------------------
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
[
https://community.jboss.org/message/793026#793026]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]