General J2EE: Distributed transactions within different JVMs and servers
- Posted by: JEROME CAMUS
- Posted on: April 21 2010 05:23 EDT
I am wondering if it possible to do the following architecture :
ServerA initiates a Transaction and send call different services into ServerB with this transaction
ServerB uses the transaction created into serverA to insert data.
ServerA at the end of serverB calls, commit the transaction if no problem occurs, otherwise it rollbacks all data inserted if serverB reports any problem.
- Distributed transactions within different JVMs and servers by ntumba lobo on May 11 2010 08:53 EDT
It looks like a distributed transaction with a single remote datasource, so the answer would be yes.
On your serverA you would have a JTA transaction which would be the transaction coordinator, and the transaction manager on serverB would participate in the transaction initiated by by the transaction coordinator.
The 2PC protocol will assure you that serverA commits only if serverB commits