JBoss Community

Re: Spring 3 & jBPM 5 & LocalTaskService

created by John Bize in jBPM - View the full discussion

Maciej,

 

I appreciate your responding tho this.

 

Just FYI, I can't post code snippets, because my project is on an isolated network.  In fact, I can only import non-beta libraries.  Anything else has to be typed in.  So if you know of software or examples, please point me to any JARs I would need and not only test code on github.

 

I've found some posts indicating some of the same problems, but there don't appear to me a lot of people using the LocalTaskService too.

 

My project stack is:

  • Spring 3.1.0.RELEASE
  • jBPM 5.2.0.Final
  • Drools 5.3.1.Final
  • Richfaces 4.2.2.Final
  • Hibernate 3.5.6-Final
  • Java 1.6 (Weblogic 10.3.4 or Tomcat 6)

 

I started with three separate but related persistence units, one for each of the jBPM Process, the jBPM Task, and my own Application data.  I tried to use JTA, but ran into: java.lang.IllegalStateException: A JTA EntityManager cannot use getTransaction()

 

I'm running in a Weblogic container, but all my dependencies are in my WAR. (i.e. It will run in Tomcat too.)

 

So, I consolidated all of my persistence units into one, and used the Spring JPA Transaction Manager (<tx:annotation-driven...).  That seemed to work until I realized that there were some pretty serious race conditions.  It looks like the jBPM has wrappers that aren't respcting the Spring Transaction boundaries.  For example, if I'm reading TaskInfos while someone is processing one of the Tasks, I get errors instead of the current data.  Data from the two transactions should not interact.  It looks like stuff is being partially committed beyond my control.

 

Idealy, I would be able to enable JTA transactions in my application and just let transactions for the original three Persistence Units be managed properly.  Alternatively, it might work if I left the PUs combined, but somehow disabled jBPM transaction management, instead setting the @Transactional boundaries only in my service layer APIs.

 

I hope you can shed some light, offer up configuration and code examples, or even a tutorial.  If upgrading to the latest jBPM, Hibernate, and Spring would solve all my problems, I would happily go that route.

 

Thanks very much,

John

Reply to this message by going to Community

Start a new discussion in jBPM at Community