Hello community,
I?m still evaluating jBPM.
I have been testing the pessimistic lock mechanism but I couldn?t get it to
work, maybe I didn?t understand it.
I created a workflow (start->node1->node2->end1) and save an instance of it in
the database. I tried to read, lock and execute the saved instance with 2
clients, and both managed to read, execute and save the instances in the
database. The lock didn?t work.
Here?s the code:
jbpmSession.beginTransaction();
processInstance =
jbpmSession.getGraphSession().loadProcessInstance(3961);
jbpmSession.getGraphSession().lockProcessInstance(3961);
ContextInstance contextInstance = processInstance.getContextInstance();
Iterator it=jbpmCtxt.entrySet().iterator();
while(it.hasNext()){
Map.Entry entry=(Map.Entry)it.next();
contextInstance.setVariable((String)entry.getKey(),
entry.getValue());
}
while(!processInstance.hasEnded()){
processInstance.signal();
}
jbpmSession.getGraphSession().saveProcessInstance(processInstance);
jbpmSession.commitTransaction();
Both bode1 and node2 have a loop that takes 40 seconds to end. I run client1
and while it is in the loop, I run client2. As I said, both read and write to
the database. Am I doing something wrong? I?m using jBPM 3.0.2.
Thanks
Giuliano
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3928319#3928319
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3928319
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user