cancel
Showing results for 
Search instead for 
Did you mean: 

explorer transactionality

heymjo
Champ on-the-rise
Champ on-the-rise
Hi,

Since the explorer uses REST to drive all its workflow interactions from the work list, how can one guarantee good transactional behaviour for the case where for example a java service task updates another database schema ? It is possible that the service task runs through fine and commits, but that the subsequent activiti engine database updates (to advance the workflow) fail due to exceptional error conditions e.g tablespace is full, datasource has no free connections …

Is this scenario considered as a known risk in the current architecture ?

For our workflow use cases i would have preferred if the explorer would just use the engine directly with a configured datasource, that would probably make it trivial to have all db interaction during workflow execution enlisted in an XA transaction.

Thanks,
Jorg
4 REPLIES 4

frederikherema1
Star Contributor
Star Contributor
Hi,

The explorer indeed just uses rest-api to communicate to the engine. So if you want to use ServiceTasks that update other DB, the java-code will have to run inside the activiti-rest webapp, the same app where the used activiti engine is running.

If you want to update own DB-tables that live inside the same datasource as activit tables do, you can leverage Spring transactionmanager to integrate your services (and entities) using the same transactionmanager (good example of this can be found in the userguide, Spring and JPA chapters: http://activiti.org/userguide/index.html#N1140A and http://activiti.org/userguide/index.html#N10479).

If you want to use different DataSource, you'll have to use XA-transactions, like you would in any other java app with this requirement…

heymjo
Champ on-the-rise
Champ on-the-rise
Hi Frederik,

If activiti-explorer runs on server A and activiti-rest on server B, how can the activiti engine running on server B participate in the transaction that the service task on server A uses to update the database , using XA ? WS-AtomicTransaction would be an option on our application server (weblogic) but then activiti-rest would no longer be rest and i would have to modify a lot of things i think.

Maybe if we keep explorer and rest app on the same server it might be easier, but reading from the forum it seems that such XA support is in the pipeline still for activiti.

Thanks for your thoughts
Jorg

frederikherema1
Star Contributor
Star Contributor
Hi,

Explorer doesn't actually execute the process (and execute the service-tasks), the rest-webapp does this.

heymjo
Champ on-the-rise
Champ on-the-rise
8-) 

that somehow was not clear to me. Excellent !!