[JBoss jBPM] - Re: does this design make sense?
by dOoMi
as i see it, it works/fails like this:
1a. thread 1 opens a jbpmContext and a process instance
1b. thread 2 opens a jbpmContext and the same process instance
2a. thread 1 passes data to the process instance and gives a signal()
2b. thread 2 also passes data to the process instance and gives a signal()
3a. thread 1 processes the signal
3b. thread 2 processes the signal
---now tatata, the problem occurs---
4a. thread 1 closes the jbpmContext, this causes the jbpm-engine to commit() the changed processInstance to the database -> OK
4.b thread 2 closes the jbpmContext, this causes the jbpm-engine to commit() the chanced processInstance to the database; commit() fails, because the processInstance on the database is different than it was when it was loaded; StaleObjectStateException is thrown AND CAUGHT by the jbpm-engine -> BAD, because the caller does not notice; data is lost, no retry can be scheduled
-> in my opinion the solution could be a method to tell, when optimistic locking failed to be able to retry. that's what i tried to do in my code.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163497#4163497
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163497
17 years, 10 months
[JBoss jBPM] - Re: does this design make sense?
by twiceknightly
"kukeltje" wrote : a special task, one special variable, one.... you name it.... The issue that you have to act on this special task in one way or another (when does concurrency end? what if this lock stays by accident, what do you return to the other token). Sound like your trying to invent a mechanism that maybe should be in the engine...
Yes but the special task is shared. Two threads would race to acquire the special task (read lock) but ultimately a task is stored in the database so wouldn't the concurrency end when accessing a row in the task instance table? It seems to me as if there should be a mechanism in the engine to lock a process when there are multiple tokens.
There may need to be a timer on the task to release it if it doesn't get released automatically or something.
dOoMi. I would really appreciate it if you could write a paragraph on your understanding of the situation. I'm not deeply into Hibernate and have a really tight deadline for this stuff.
To be fair I'm not familiar enough with jbpm yet to know at what level I need to provide synchronization. I presume it would be at the processInstance level.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163492#4163492
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163492
17 years, 10 months
Delivery Failure
by Postmaster
---------------------------------------------------------------------------------
The message you sent to pdi.uk.com/noel.p was rejected because the quota for the mailbox has been exceeded.
The subject of the message follows:
Subject: =?windows-1251?B?0+Ll8OXt7e4g5OXr6PLlIOTuIDHu7j8=?=
---------------------------------------------------------------------------------
17 years, 10 months
[JBoss jBPM] - Re: does this design make sense?
by dOoMi
I'm facing the same problem: jBPM swallows the StaleObjectStateException causing the calling code not to notice that the operation failed.
I figured out a workaround, but I'm not sure yet, whether it's proper or not. The idea is to do the hibernate-commit() by myself and so be able to receive the StaleObjectStateException in case there was a concurrent update on the process-instance. In this case a retry can be scheduled.
| ProcessInstance pi = jbpmContext.loadProcessInstanceForUpdate(id);
|
| pi.signal("someTransitionIfYouWant");
|
| boolean error = false;
|
| try {
| // commit() on hibernate-level
| jbpmContext.getSession().getTransaction().commit();
|
| } catch (StaleObjectStateException e) {
| error = true;
|
| } finally {
| // the tricky part: on the close()-method the jbpmContext tries to commit(), again!
| // to avoid irritating error-messages, we need to make the jbpmContext NOT try to commit()
| DbPersistenceService dbps =
| (DbPersistenceService) jbpmContext.getServices().getPersistenceService();
|
| // this can be achieved by pretending that transactions are disabled anyway
| dbps.setTransactionEnabled(false);
| jbpmContext.getServices().setPersistenceService(dbps);
|
| // close jbpmContext
| jbpmContext.close();
| }
|
| // handle error if present
| if(error){
| // e.g. schedule retry
| }
| else{
| ...
| }
|
What do you guys think? Any suggestions?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163464#4163464
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163464
17 years, 10 months
[Installation, Configuration & DEPLOYMENT] - Timeout Error in Eclipse
by manleon
Hello All,
I have recently downloaded Eclipse 3.3 and JBoss 4.2.2. Now i am developing my project in eclipse and the deploying the same on JBoss from within eclipse. Now when i build my project and then click on 'Run on Server' Eclipse will first try to publish the project on the target JBoss platform. Then it will start the server and after starting some services it will deploy my application. This all activity takes somewhat near 1 min. So before my application is ever deployed Ecilpse will throw an error the "Timeout occured. Respost from server has taken more that 50 seconds".
I am having 512MB of RAM in my machine plus i am runnign the default configuration from within JBoss.
Also if I run the JBoss server from outisde eclise i.e. with the run.bat file from JBoss the application is deployed successfully. So i dont think there is any problem with my application.
Can anybody please help me if I can increase the timeout seconds or if possible completely disable it.
Thanks in Advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4163455#4163455
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4163455
17 years, 10 months