JBoss Community

Re: JBPM's persistence reusing existing connection

created by gardellajp in jBPM - View the full discussion

Hi Andres,

 

See http://docs.jboss.org/hibernate/entitymanager/3.6/reference/en/html/architecture.html#architecture-ejb-persistctxpropagation.

 

In a transaction-scoped container managed entity manager (common case in a Java EE environment), the JTA transaction propagation is the same as the persistence context resource propagation. In other words, container-managed transaction-scoped entity managers retrieved within a given JTA transaction all share the same persistence context. In Hibernate terms, this means all managers share the same session.

 

So, you share session with JTA. Good things that jBPM JPAKnowledgeService use JTA to obtain transactions. JPAKnowledgeService javadoc says:

 

Long term out of the box persistence of runtime state with JPA is possible with Drools & jBPM. You will need to configure a JPA entity manager (e.g. using hibernate) and have a JTA transaction manager (for development/testing purposes we recommend Bitronix as it's simple to setup and works embedded, but for production the use of JBoss Transactions is recommended).

 

Correct me Mauricio if I don't understand well how manage persistent in jBPM with JPAKnowledgeService. Andrés you can refer to some database with JTA, see http://stackoverflow.com/questions/3217586/difference-between-a-jta-datasource-and-a-resource-local-datasource

 

Juan

Reply to this message by going to Community

Start a new discussion in jBPM at Community