title: How to call a custom rollback method in Spring Transaction Management?
body: <p>Environment: Spring 3, Custom Transaction Management, JDBC Transactions</p>
  
  <p>I just read the Spring docs on using the transaction template to handle transaction management. <em>It seemed overly complex</em> so I want to ask:</p>
  
  <p>Most of my transactions are JDBC related, meaning I just declare an <code>@Transactional</code> on my service. But now <strong>I am making a REST service call to another site which needs to rollback if any of the following JDBC operations fail</strong>, I'll provide the rollback code in this case.</p>
  
  <p>As I progress in my method, in my transaction - I want to <strong>save a reference to the REST service call</strong> (needed to roll back that action), and upon exception I just <strong>want a method <code>myCustomRollback()</code> called</strong> which can access the previously stored object.</p>
  
  <p>Why not just provide a map in the transactionTemplate for storing stuff and define a custom rollback method on the <code>@Transactional</code> annotation? </p>
  
  <p>This is the way I think about it, I'm not following the way Spring thinks about this. Can someone help me bridge the gap between what I want and how I accomplish it most efficiently in Spring? I only need to do this for a few special case operations.</p>