-
1. Re: ProcessInstance.save not working without closing JbpmCon
senhce May 2, 2006 5:31 AM (in response to sbhatti)I too observed the same, when ever you do a save operation without closing the context the changes to the process instance is not persisted. I guess probably thats the behaviour of the context, so that you can rollback if something goes wrong while working with your instance.
Thanks,
Senthil B -
2. Re: ProcessInstance.save not working without closing JbpmCon
sbhatti May 2, 2006 10:26 AM (in response to sbhatti)I found a work around by managing transaction myself, i.e.
Transaction txn = jbpmContext.getSession().beginTransaction();
jbpmContext.save(processInstance);
txn.commit();
and I see the changes in the database right away. I am still curious why jBPM has this particular behavior? -
3. Re: ProcessInstance.save not working without closing JbpmCon
kukeltje May 2, 2006 6:09 PM (in response to sbhatti)why do you not want to close the jbpm context? but to want to save the processinstance?
-
4. Re: ProcessInstance.save not working without closing JbpmCon
the_dude May 4, 2006 2:40 AM (in response to sbhatti)Take a look at the examples: You'll find useful code for your JbpmContext / transaction problems in
src/java.examples/org/jbpm/websale/WebsaleTest.java and src/java.jbpm.test/org/jbpm/db/AbstractDbTestCase.java
p.s.: Try creating your process instances like this:ProcessInstance processInstance = new ProcessInstance(processDefinition);