AnsweredAssumed Answered

Transactions in Java Service Tasks

Question asked by oticman on Apr 24, 2012
Latest reply on Apr 24, 2012 by oticman
Hi all,
I'm going to use for the first time Activiti in a new document management project, so I would like to understand what are the 'best practice' to set up an application like this one.
I want to keep this application really lightweight, so I will use only a servlet container (like tomcat), jpa1 for persistence and I would prefer to avoid Spring, because the developing team is not skilled in it.
Activiti is really wonderful framework and I'll use it in the future, probably also when there will not be a real 'bpm requirement', because it is useful to 'organize' the whole application.
So, I would like to understand some points :

1) Is it possible to use Activiti in a plain java web application ? (No EJB, No Spring, Only Local Transactions)
2) Is it mandatory to use JTA or XA transactions ?

If it's possible to use simple local transactions, then I would like to understand how can I share with Activiti the same db connection (or EntityManager in JPA) to use it in all custom java code, such as JavaDelegate classes. I think that sharing connection is the only way to maintain a good transactional consistency between Activiti db operations and JavaDelegate custom db operations ? Isn't it ? 

I think it would be a great help if someone added to wiki or to user guide some scenarios of 'real world' usage, with persistence actions within java service tasks or java listeners.


Thank you very much for the awesome work !

Ottavio

Outcomes