title: Spring Boot @Transaction not rolling back on RuntimeException
body: <p>I have a spring boot application that is using spring-boot-starter-jdbc, Java 8 and MySQL with InnoD. The application isn't rolling back Runtime Exceptions, even when I do this:</p>
  
  <pre><code>throw new RuntimeException("Rolling back");
  </code></pre>
  
  <p>I am configuring my Transactions like this:</p>
  
  <pre><code>@Transactional(propagation = Propagation.REQUIRED, readOnly = false)    
  </code></pre>
  
  <p>I am using the Spring Boot Actuator and I can see this in the Hal Browser:</p>
  
  <pre><code>"DataSourceTransactionManagerAutoConfiguration": [
    {
      "condition": "OnClassCondition",
      "message": "@ConditionalOnClass found required classes 'org.springframework.jdbc.core.JdbcTemplate', 'org.springframework.transaction.PlatformTransactionManager'"
    }
  ],
  "DataSourceTransactionManagerAutoConfiguration.DataSourceTransactionManagerConfiguration": [
    {
      "condition": "OnBeanCondition",
      "message": "@ConditionalOnSingleCandidate (types: javax.sql.DataSource; SearchStrategy: all) found a primary bean from beans 'psmDataSource', 'dataSource'"
    }
  ],
  "DataSourceTransactionManagerAutoConfiguration.DataSourceTransactionManagerConfiguration#transactionManager": [
    {
      "condition": "OnBeanCondition",
      "message": "@ConditionalOnMissingBean (types: org.springframework.transaction.PlatformTransactionManager; SearchStrategy: all) did not find any beans"
    }
  ],
  "DataSourceTransactionManagerAutoConfiguration.TransactionManagementConfiguration": [
    {
      "condition": "OnBeanCondition",
      "message": "@ConditionalOnMissingBean (types: org.springframework.transaction.annotation.AbstractTransactionManagementConfiguration; SearchStrategy: all) did not find any beans"
    }
  ],
  </code></pre>
  
  <p>I'm assuming that this means that a Transaction Manager has been successfully configured, so I'm not sure why the transactions aren't being rolled back.Is </p>
  
  <p>Any ideas?</p>
  
  <p>DAO Interface:</p>
  
  <pre><code>public interface IContestService {
      @Transactional(propagation = Propagation.REQUIRED, readOnly = false)    
      ContestDTO create(final ElectionEventDTO electionEvent, final ElectionDTO election, final ContestDTO contest, final PollingPlaceDTO pollingPlace, final List&lt;CandidateDTO&gt; candidates);
  }
  </code></pre>
  
  <p>DAO Implemtnation:</p>
  
  <pre><code>@Override
  public ContestDTO create(final ElectionEventDTO electionEvent, final ElectionDTO election, final ContestDTO contest, final PollingPlaceDTO pollingPlace, final List&lt;CandidateDTO&gt; candidates) {
  
      if(electionEvent.getId() == null) {
          getElectionEventService().save(electionEvent);
      }
  
      if(election.getId() == null) {
          election.setElectionEvent(electionEvent);
          getElectionService().save(election);
      }
  
      if(election != null) {
          throw new RuntimeException("Rolling back");
      }
      contest.setElection(election);
      getContestDAO().save(contest);
  
      getCandidateService().save(candidates);
  
      /**
       * Return the contest
       */
      return contest;
  }
  </code></pre>
  
  <p>application.properties:</p>
  
  <pre><code>logging.file=cm-web.log
  logging.level.org.springframework.web=DEBUG
  
  countdb.datasource.url=jdbc:mysql://localhost/countdb
  countdb.datasource.username=root
  countdb.datasource.password=pass123
  countdb.datasource.driver-class-name=com.mysql.jdbc.Driver
  
  psm.datasource.url=jdbc:mysql://localhost/psm
  psm.datasource.username=root
  psm.datasource.password=password
  psm.datasource.driver-class-name=com.mysql.jdbc.Driver
  </code></pre>