I am confused. I have used jBPM in a JTA environment since last March at least, using the following configuration in the jbpm.cfg.xml file:
<service name="persistence"> <factory> <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory"> <field name="isTransactionEnabled"><false/></field> </bean> </factory> </service>
With this configuration, the jbpmContext.close does not commit the transaction or close the Hibernate session.
As for using the Hibernate session with jBPM, it would be nice for jbpm to use the sessionFactory.getCurrentSession() method. In the past I have injected the Hibernate session into jBPM using jbpmContext.setSession(s);
This is useful, I suppose, but is not really enough for Seam, since Seam is not using the "current" Hibernate session. What I really want to be able to do is pass a sesison to the method that creates a jbpm context. Yes, I also need the behavior that jBPM does not flush or close the session, or commit the transaction.
Or are you saying that you are using getCurrentSession() of the SF that you create internally.
Ah, well, thats fine.
But one of these days I would really like to be able to have a single persistence context for user entities and jBPM entities. Well, I guess its not as critical for now.
if you want to use 1 session, you can inject it into the jbpmContext with the setSession(Session) method
at the jbpmContext.close, the session is not going to be flushed or closed by jbpm.