title: How to manage transactions in spring boot
body: <p>I have a spring boot application and use camel with it, I read a file and then I try to inserted on my DB, everything is working good the only problem is that I try to use <code>@transactional</code> or <code>transactionTemplate</code> to make a rollback when an error occur but it doesn't make the rollback,</p>
  
  <p>With the <code>@transactional</code> I add to my SpringBootApplication the <code>@EnableTransactionManagement(proxyTargetClass=true)</code> and in my class I add the <code>@Transactional(rollbackFor = Exception.class)</code></p>
  
  <p>These are my classes:</p>
  
  <pre><code>@SpringBootApplication
  @EnableDiscoveryClient
  @EnableTransactionManagement(proxyTargetClass=true)
  public class MsArchivo510Application {
  
      public static void main(String[] args) {
          SpringApplication.run(MsArchivo510Application.class, args);
      }
  }
  
  @Service
  public class ArchivoBS implements Processor{
      @Transactional(rollbackFor = Exception.class)
      @Override
      public void process(Exchange exchange) throws Exception {
          //Here I execute stored procedure and one of them fail
      }
  }
  </code></pre>
  
  <p>With the transactioTemplate my class end up like this:</p>
  
  <pre><code>@Service
  public class ArchivoBS implements Processor{
      @Override
      public void process(Exchange exchange) throws Exception {
  
          transactionTemplate.execute(new TransactionCallbackWithoutResult() {
  
              @Override
              protected void doInTransactionWithoutResult(TransactionStatus status) {
              try {
                  //Here I execute stored procedure and one of them fail
              } catch (Exception e) {
                  e.printStackTrace();
                  status.setRollbackOnly();
              }
          }
         });
      }
  }
  </code></pre>
  
  <p>Am I missing something?, Can someone help me with this issue?,</p>
  
  <p>Thanks in advance</p>