-
1. Re: please help: concurrent paths execution
estaub May 30, 2007 8:55 AM (in response to ax666)Alex,
Do you understand how your fix of yesterday (see http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049235#4049235) is not working?
I see two possibilities, but I don't know the code that well, so both could be wrong... you might want to instrument for these...
1.) Imagine that acquireJobs() has just finished executing on one thread, and the engine is now working on those jobs. Another job for the same process instance is queued, and another thread picks it up. In my admittedly brief reading, I don't see what synchronizes access to the process instance.
2.) In your case, I believe the jobs will be on the subprocesses, but both threads end up modifying the parent process. Is there anything synchronizing access to the parent process? I don't see it. The key point appears to be ProcessInstance.end().
You should probably update the JIRA.
Also, in the JIRA you might more pointedly refer to the forum discussion(s).
-Ed Staub -
2. Re: please help: concurrent paths execution
ax666 May 30, 2007 9:59 AM (in response to ax666)Ed, my yesterday's fix (or hack) does work so far, concerning job acquirement. I think all the hibernate sync doesnt work with multiple threads in one process instance. I wish someone from jboss would say a word, but I guess they're either tired of repeating "it's a business process tool, not a thread scheduler" or it's just the usual no time/no desire/whatever....
threads and their hibernate sessions are not sync'd between each other, but I dont know if thats just incorrect use, wrong configuration or bugs. I need this thing get to work soon without spending days on it, otherwise I will need to look for something different that works out of the box (which probably doenst exist)...
A. -
3. Re: please help: concurrent paths execution
estaub May 30, 2007 10:42 AM (in response to ax666)Alex,
In ProcessInstance.end(), consider session-locking the parent process token while the signal() is performed on it. Sorry, I don't know where to get the Session object from, what locking mode to use, etc. - I'm not skilled with Hibernate yet. Look at Join.execute() as a model.
I appreciate where you're coming from with some of your other comments...
-Ed Staub -
4. Re: please help: concurrent paths execution
ax666 May 30, 2007 10:49 AM (in response to ax666)I could synchronize in JobExecutorThread on the parent token, but that hack seems even dirtier than the other. I'll give it a try though ;)
What did everyone else do in case of concurrent threads in a process instance? the discussions I found in the forum never came to a conclusion...
I'm leaving the jira issue as is for now... -
5. Re: please help: concurrent paths execution
kukeltje May 30, 2007 11:01 AM (in response to ax666)I think most people do not have STP kind of processes where multiple threads need to have access to the same processinstance (and yes, it is not thread a thread scheduler ;-) and yes they have desire, no time, well limited at the moment, but (shameless plug) you could order commercial support ;-).
I'll signal the developers make a statement/comment on this. -
6. Re: please help: concurrent paths execution
tom.baeyens May 30, 2007 11:13 AM (in response to ax666)if you don't want jobs from the same process instance to be executed concurrently, you should try async="exclusive"
don't remember if i also added this for timers. the idea is that exclusive jobs will all be acquired by 1 thread in one tx. and then they are executed by that single thread sequentially. -
7. Re: please help: concurrent paths execution
kukeltje May 30, 2007 11:17 AM (in response to ax666)Look.... guys.... isn't this great..... at 11:01 according to the post (it was 17:01) here. I posted, then send a mail to the developers et voila at 17:13 local time they responded... compliments to the JBoss guys...
-
8. Re: please help: concurrent paths execution
ax666 May 30, 2007 11:22 AM (in response to ax666)good to know, but actually I want them to be executed concurrently. I have (long running) sub processes that have to be executed simultaneously, two for now, but more later. it's just the synchronization in the parent process that is making trouble.... concerning "exclusive" : I noticed that some attributes/values are in the code, but not in the documentation and not in the schema.... just not stable enough?
-
9. Re: please help: concurrent paths execution
ax666 May 30, 2007 11:24 AM (in response to ax666)"kukeltje" wrote:
Look.... guys.... isn't this great..... at 11:01 according to the post (it was 17:01) here. I posted, then send a mail to the developers et voila at 17:13 local time they responded... compliments to the JBoss guys...
everyone is fresh and full of energy at this morning time ;) -
10. Re: please help: concurrent paths execution
kukeltje May 30, 2007 11:40 AM (in response to ax666)According to http://jira.jboss.com/jira/browse/JBPM-713 it is implemented for timers to. Where should this go in the docs.... I cannot find it in there. Then I can create a jira issue for adding this to the docs.
Does 'exclusive' mean that the other jobs for other proces instances will be executed in parallel to this one? -
11. Re: please help: concurrent paths execution
kukeltje May 30, 2007 11:44 AM (in response to ax666)Docs and schema are behind..... as always... :-)
btw, surprise Ax666 this developer is in europe and so it is the END of the workingday.....5pm!! -
12. Re: please help: concurrent paths execution
ax666 May 30, 2007 12:01 PM (in response to ax666)developers have their special day schedule, no developer would have a clear mind at 7 am ... :)
my bad hack is working, I'm synchronizing on the parent token before I let the JobExecutor thread execute the job. I will play with that a little more, but I guess this is what we will be using...
Still, I think this issue should be solved in a clean way...
Alex -
13. Re: please help: concurrent paths execution
estaub Jun 6, 2007 9:54 AM (in response to ax666)Ronald,
I haven't written a test yet, but as I read the code this is not implemented for timers. See CreateTimerAction.java.
Also, relative to both this and Alex's other problem of today (http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051686#4051686)
I really need to write a test for this. To repeat: as I see it, if a thread is executing an exclusive job for a token, and another event comes in on the same token that spawns a job, there's nothing preventing another thread from trying to run with it, theoretically resulting in what Alex is seeing in both cases.
-Ed Staub