Reputation: 71
My application is based on jBPM 5 and because of some clustering problems I am testing jBPM 6 to replace the old version. I used example from: https://github.com/jsvitak/jbpm-6-examples/tree/master/rewards-basic
Unfortunately, as far as I have tested it, it still has issues with sharing the same KSession with multiple nodes.
The RuntimeManager was set to use singleton strategy.
RuntimeEnvironment environment = RuntimeEnvironmentBuilder.Factory.get()
.newDefaultBuilder()
.entityManagerFactory(emf)
.addAsset(ResourceFactory.newClassPathResource("rewards-basic.bpmn"), ResourceType.BPMN2)
.get();
environment.getEnvironment().set(EnvironmentName.USE_PESSIMISTIC_LOCKING, true);
singletonManager = RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(environment);
RuntimeEngine runtime = singletonManager.getRuntimeEngine(new Context() {
@Override
public Object getContextId() {
return singletonManager.getIdentifier();
}
});
KieSession ksession = runtime.getKieSession();
Map<String, Object> params = new HashMap<String, Object>();
params.put("recipient", recipient);
ProcessInstance processInstance = ksession.startProcess(
"com.sample.rewards-basic", params);
The test is simple:
And after step two, I always facing the same Hibernate exception as for jBPM 5:
Caused by: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.drools.persistence.info.SessionInfo#1]
On jBPM 5 I reloading the KSession from database, but I refering to it as workaround.
My application has the requirement that the same process instance must be accessible by different users logged to different nodes. Processes have human task, are stateful and are considered to be long-running (days, months). Tasks are carried out quickly.
So, my questions are:
Upvotes: 4
Views: 1191
Reputation: 71
Some answers to my questions above have been written in jbpm forum: https://community.jboss.org/message/863749#863749
Upvotes: 2