Issue in suspend or activate a process instance but the 'status' not refresh till 'restart' the J2EE Server
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2014 09:32 PM
Recently I am developing a system for our Gov and I found a issue during "Suspend/Activate" a process instance.
Following steps can recreate this issue:
1. Deployed the "activiti-rest" and the "activiti-explorer" into a same jboss, and make sure they connected to a same DB(I use the DB Jndi)
2. Suspend or activate a process instance in the "activiti-explore".
3. I found after I suspend or activate a process instance thru the activiti-explorer, I can still use the REST interface "http://localhost:8080/activiti-rest/service/runtime/process-instances" to start the process instance. Seems the "status" not refresh immediately…and I restart the JBOSS, then I tried to start the process instance like "myProcess" then I got the exception "myProcess:9:8451 is suspended, can not start".
My question is:
Why the activated or suspended status not refresh immediately? until I restart the JBOSS/TOMCAT, then the activated or suspended status will be effected? This is quite inconvenience, is there any way to activate or suspend the process instance immediately or I missed something else?
Following steps can recreate this issue:
1. Deployed the "activiti-rest" and the "activiti-explorer" into a same jboss, and make sure they connected to a same DB(I use the DB Jndi)
2. Suspend or activate a process instance in the "activiti-explore".
3. I found after I suspend or activate a process instance thru the activiti-explorer, I can still use the REST interface "http://localhost:8080/activiti-rest/service/runtime/process-instances" to start the process instance. Seems the "status" not refresh immediately…and I restart the JBOSS, then I tried to start the process instance like "myProcess" then I got the exception "myProcess:9:8451 is suspended, can not start".
My question is:
Why the activated or suspended status not refresh immediately? until I restart the JBOSS/TOMCAT, then the activated or suspended status will be effected? This is quite inconvenience, is there any way to activate or suspend the process instance immediately or I missed something else?
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2014 03:25 AM
I guess you're talking about suspending a process definition, rather than a process instance? The issue here has to do with process-definition caching. Parsed process definitions are cached in-memory for performance reasons. An entity updated in another JVM/activiti-engine will nog update the cache on other engines, leaving behind the "unsuspended" definition to use, when it should be suspended.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2014 12:50 AM
Hi Fred,
Yes, to suspend the definition in activiti-explorer, but the status was not changed in activiti-rest.
So, this issue caused by the process definition status is maintained in memory right?
Yes, to suspend the definition in activiti-explorer, but the status was not changed in activiti-rest.
So, this issue caused by the process definition status is maintained in memory right?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2014 05:23 AM
Yes, correct. And also because you have two instances of the Activiti engine, with their own cache.
A solution would be to package both apps in one webapp, with one Activiti engine.
Another, way more advanced one, would be to use a distributed cache: http://www.jorambarrez.be/blog/2013/01/03/distributed-cache-activiti/
A solution would be to package both apps in one webapp, with one Activiti engine.
Another, way more advanced one, would be to use a distributed cache: http://www.jorambarrez.be/blog/2013/01/03/distributed-cache-activiti/
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2014 10:47 AM
Hi jbarrez,
According to your solution, merged two app into one, and the issue solved, thanks again.
According to your solution, merged two app into one, and the issue solved, thanks again.
