cancel
Showing results for 
Search instead for 
Did you mean: 

External Application Transaction Management

sobh540
Champ in-the-making
Champ in-the-making
Dear Activit Users,

In my company, we have requirement for workflow and i have been working on it from last 2 weeks. I am planning to integrate Activiti (bundled in my EAR) into my application with two different schemas (one for app and the other for Activiti procesess). I have few queries, i tried searching for the same, but couldn't fine one.

1. How can i use 2 transaction managers (1 for activit process related transactions and the other for app transaction manger) in a single
transaction?
Eg.
step1 : Application creates a record into application database
step2 : create process instance
step3 : update record
If there any exception in the above steps i want to rollback the complete data and show error.

2. If i invoke multiple process in step2, if one of process got exception how do i mainatin the transaction?
7 REPLIES 7

trademak
Star Contributor
Star Contributor
Hi,

In the user guide a transaction manager is described using the Spring container. Did you read it?

Best regards,

sobh540
Champ in-the-making
Champ in-the-making
Hi,

In the user guide a transaction manager is described using the Spring container. Did you read it?

Best regards,


Hi,

I have read about transaction management using Spring, But its describes container managed transactions and also we are planning to use Actitivi without Spring in my application. We are planing to manage all transaction using sql connections, based on the error scenario (use case) we may commit complete transaction or rollback the transaction.

The way that we are planning is :

1. We capture all the data required for the process from UI (user or system will get the required data)
2. Once the data available, will invoke a process which will basically do some input validations, business validations and then create records into diff. tables using Java Service Task. For activiti process related db interactions we will use activiti schema and for app we will use application schema. I can write a service which will be called from JavaDelegate, I can get sql connection within serviceimpl and do business checks and finally created record and also there could be diff. service call (mutliple calls) from delegate depending on the input passed. If i have multiple call withing delegate, there could be a possibility to fail one of the service call.
3. I want the above all the steps should in a single transaction. I want to maintain transactions using DB connections.

Would you please suggest a solution for the above.

Thanks in advance!

trademak
Star Contributor
Star Contributor
Hi,

With only DB transactions you can't.
You'll need a container managed transaction mechanism, either from your application server or from Spring.

Best regards,

sobh540
Champ in-the-making
Champ in-the-making
Hi,

Lets say if i go with spring container can application db calls (Application sepcific) and process related call (used by activiti) be maintained in single transaction?

I have below requirement :

1. Captured all required data for a process
2. Do some kind processing on the data (App db call)
3. Call createProcessInstanceByKey with input data (Both App and Activiti db call)
4. Update results in DB (using App db call)

If any one of above step or any exception inside process instance execution fails i should be able to rollback or commit based on
the error code etc. is it possible??

If i use Spring container to manage transaction and i have two diff. schema's (1 for app and other for activiti) how the transaction being managed? will the activiti use the same transactionManager confired for the app?

Thanks in Avance!

xiegs2007
Champ in-the-making
Champ in-the-making
Hi,

Lets say if i go with spring container can application db calls (Application sepcific) and process related call (used by activiti) be maintained in single transaction?

I have below requirement :

1. Captured all required data for a process
2. Do some kind processing on the data (App db call)
3. Call createProcessInstanceByKey with input data (Both App and Activiti db call)
4. Update results in DB (using App db call)

If any one of above step or any exception inside process instance execution fails i should be able to rollback or commit based on
the error code etc. is it possible??

If i use Spring container to manage transaction and i have two diff. schema's (1 for app and other for activiti) how the transaction being managed? will the activiti use the same transactionManager confired for the app?

Thanks in Avance!

I hava the similarly question ,but I can't even integrate activiti58 with my spring,questions are:
1,activiti use mybatis,my program use hibernateJPA;
2,so there are two dataConnect,or two datasource?
what directiion I go?

trademak
Star Contributor
Star Contributor
Hi,

@sobh540 Right, if you would use the Spring transaction manager you could do several tasks within the same transaction.

@xiegs2007, if you have multiple data sources you definitely need a XA transaction manager

Best regards,

xiegs2007
Champ in-the-making
Champ in-the-making
Hi,
@xiegs2007, if you have multiple data sources you definitely need a XA transaction manager
Best regards,

thank you for answer.
I don't want complex way,whate I realy want is:
how integrate activiti58 into my SpringMVC which used hibernateJPA?

today I read the posts published by developer of Activiti,and understand that use with hibernateJPA is unsupported because LGPL licence and software test and sql's convenience …
so I don't ask this kind of question anymore!