title: How to do distributed transaction in java involving jdbc,jms and webservices
body: <p>I was asked the following question in an interview and couldn't answer that.</p>
  
  <p>How do you include a jdbc operation,a web service call and a JMS operation into one single transaction. That means if one of them fails all has to be roll backed.</p>
  
  <p>I have heard about two-phase commit protocol and oracl XA in case of database transactions involving multiple databases. But not sure whether the same can be used here. </p>