1
votes

I have two WARs running on the same tomcat server, both using Spring transactions and both writing to the same database. They communicate with each other through REST calls.

Now I have a business process that starts from foo.war, which calls bar.war, then returns back to foo.war. Both of them write to the same database, but they currently are not part of one transaction, so if foo.war fails to commit, bar.war doesn't rollback.

How can I solve this problem without integrating one war into the other?

I though a standalone JTA implementation might work, but since they are different applications, I'm not sure if it will.

1
how is the business process in foo.war calling bar.war? Is it through REST? - user2953113
Yes. I thought I indicated that. Foo and Bar communicate through rest calls. - Yamcha
@user2953113 yes, looks ugly. Not worth the try. - Yamcha

1 Answers

0
votes

I believe your use case is well suited for transaction based on TCC architecture. Pls find below links for details on the architecture :- a) Link-1 b) Link-2