I am trying to achieve a similar goal. My testing code looks like this:
| SessionFactory sesionFactory = new
org.hibernate.cfg.Configuration().configure("jbpm.hibernate.cfg.xml").buildSessionFactory();
|
| JbpmConfiguration config = new JbpmConfiguration();
| config.setSessionFactory(sesionFactory);
| ProcessEngine processEngine = config.buildProcessEngine();
|
| Transaction trx = sesionFactory.getCurrentSession().beginTransaction();
|
| ExecutionService executionService = processEngine.getExecutionService();
| Map<String,Object> variables = new HashMap<String,Object>();
| variables.put("username", "arash");
| variables.put("filename", "file1");
| ProcessInstance processInstance =
executionService.startProcessInstanceByKey("add_media", variables);
| MyEntity myEntity = new MyEntity();
| myEntity.setFileName("tada1");
| myEntity.setProcessId("pro1");
| sesionFactory.getCurrentSession().save(myEntity);
| trx.rollback();
|
There is no transaction manager configured in the hibernate config file and this is a JDBC
transaction.
The result is jbpm writing the new process to the database even though I rolled back the
transaction.
Could somebody tell me please how can I manage the transaction probabely.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4245032#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...