-
15. jboss as 5 jbpm 5.1 persistence
michal.warecki May 5, 2011 3:14 AM (in response to zorin)I think the problem is only with drools tasks. I use jbpm statefull knowledge base with clean jboss transactions and everything works with CMT ( Container Managed Transactions ) without any problems.
I don't think that there is solution to make drools tasks works with JTA but I could be wrong.
jBPM/Drools developer should clear out that situation :-)
-
16. Re: jboss as 5 jbpm 5.1 persistence
mariemm May 5, 2011 7:23 AM (in response to michal.warecki)Hi,
I should mention that we use tasks without Mina server (or other), calling taskSession directly, inspirated by this discussion
http://community.jboss.org/message/595321
Not sure if this is really related to transaction problem.
My workitem handler which works with tasks looks like this:
public void executeWorkItem(WorkItem workItem, WorkItemManager manager) {
// create new task, get info from WF
// get task details from workitem
Task newTask = new Task();
String taskName = (String) workItem.getParameter("TaskName");
.....
taskSession.addTask(newTask, taskParameters);
}
What do you think?
-
17. Re: jboss as 5 jbpm 5.1 persistence
michal.warecki May 5, 2011 8:00 AM (in response to mariemm)This is not related to the problem. I think you can't do that with JTA but I'm not sure.
Mauricio Salatino should have more knowledge in this topic so I hope he will give you ( and me as well ) some advise. I'm very interested in this topic becouse I had a lot of problems with CMT and drools tasks so I hope he will answer :-)
-
18. Re: jboss as 5 jbpm 5.1 persistence
mariemm May 6, 2011 7:57 AM (in response to mariemm)Thank you for you comments, I was also hoping that Mauricio starts again responding to this discussions.
I managed to find out where and when exactly it goes down with JDBC commit failed java.sql.SQLException: You cannot commit during a managed transaction!
When the org.drools.persistence.jpa.processinstance.JPAWorkItemManager is called and then it calls some function in org.jbpm.task.service.TaskServiceSession which has doOperationInTransaction (with commit()).
In JPAWorkItemManager it calls
PersistenceContext context = ((PersistenceContextManager) env.get( EnvironmentName.PERSISTENCE_CONTEXT_MANAGER )).getCommandScopedPersistenceContext();
which propably doesn't like when there is later tx.commit(); (tx is RESOURCE_LOCAL transition)
Any further insight?
-
19. jboss as 5 jbpm 5.1 persistence
mariemm May 9, 2011 5:30 AM (in response to mariemm)Finally, I found solution for this.
In datasource for tasks it should be no-tx-datasource. See
https://forum.hibernate.org/viewtopic.php?f=1&t=998779
and http://community.jboss.org/wiki/ConfigDataSources
Thank you to all for your insights about transactions.
-
20. jboss as 5 jbpm 5.1 persistence
michal.warecki May 9, 2011 6:46 AM (in response to mariemm)This is one solution but I'm not sure that this is good solution :-) I think in this case if one of drools tasks operation fails and main transaction commit then there might be some incompatibillity in data. Am I right ?