title: How to handle transaction involving Spring message/JMS and Database
body: <p>I have a method that get an invoice and it creates XML and send that XML to a JMS queue and then save the invoice to DB with updated status like 'invoiced'. Below is pseudo code that involves Spring and Hibernate.  My question is: Is the failure in hibernate save rollsback Jms sending.or if JMS send failed, how can I roll back saving invoice status? is this comes under distributed transaction management. What are the transactional cases involved here. Thanks. </p>
  
  <pre><code> @Transactional(propagation=Propagation.Required)    
   void processInvoices(invoice ){
             String xml = createXML(invoice);
             messageService.sendInvoice(xml );
             invoice.setStatus("invoiced");
             save(invoice);
  
    }
  </code></pre>