I have a seam project where a process is started by seam through a @CreateProcess. Then one node schedule an action using Quartz. The scheduled action then sends a JMS which an MDB uses to signal the process to continue the execution.
However my problem is that once the MDB signal the process, one node will make access to the database. I get problems with transactions and it's a nightmare. I tried many things from annotating the MDB for CMT or BMT with no success. I tried injecting the hibernate session into the jbmpcontext but couldn't get my hands on the sessionfactory. Before I submit a stack trace, I would just like to know what exactly is the right way to go ?? How does one handle this transaction mess. It is really hard to find documentation on the subject or maybe I don't know where to look.
Any help will be gladly appreciated.
Use CMT and set the trans-attribute to Required. Also configure jBPM to use the JtaDbPersistenceServiceFactory. This is easier if you use jPDL 3.2.3 or later and deploy the product as an enterprise app (i.e. jbpm-enterprise.ear). See the chapter on Java EE app server facilities in the latest user guide for a description of the jBPM enterprise components.