cancel
Showing results for 
Search instead for 
Did you mean: 

Non-Spring JPA Transactions

bthule
Champ in-the-making
Champ in-the-making
I will be using a non-JTA persistence unit (eg
<persistence-unit transaction-type="RESOURCE_LOCAL">
).  And I will sometimes be creating an EntityManager and transaction, doing work in my code, and then calling Activiti.  And of course, other times, Activiti will be creating its own em and transaction, and calling my application code.  How can I configure Activiti to get/put the em from/to Guice or CDI?

Somewhat related: I know that Spring support in Activiti is not required, but with the documentation and the "Activiti in Action" book referencing Spring so much, it makes me worried about how stable/fully functional Activiti will be without it.  For instance, the Activiti documentation for JPA seems to assume that Spring will be used– which in my case it will not.  Unless it is just the documentation, then It seems like Spring and Activiti are currently tightly coupled, and I will lose important functionality unless I use Spring.  It seems that Activiti should have had a Spring "plugin" that could be swapped out for a Guice or CDI "plugin".
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
They are not tightly coupled. you can use Acitviti without Spring, if you configure the process-engine in code. See the userguide for samples on that. So you won't have a actviti.cfg.xml, instead, you'll be setting the right properties on a ProcessEngineCOnfiguration and building an engine off that instead.