Transaction doesn't work for Spring-Boot + Mybatis
<p>My application using Spring Boot + MyBatis, When I using @Transactional annotation, it doesn't rollback when throw exception.</p>

<p>My MybatisConfiguration.java is:</p>

<pre><code>@Configuration
@EnableTransactionManagement
@MapperScan("com.mode.dao")
public class MybatisConfiguration implements EnvironmentAware {

    private RelaxedPropertyResolver properties;

    @Override
    public void setEnvironment(Environment env) {
        this.properties = new RelaxedPropertyResolver(env, "mode.jdbc.");
    }

    @Bean(name = "datasource", destroyMethod = "close", initMethod = "init")
    public DataSource dataSource() {
        DruidDataSource dataSource = new DruidDataSource();
        dataSource.setDriverClassName(properties.getProperty("driverClassName"));
        dataSource.setUrl(properties.getProperty("url"));
        dataSource.setUsername(properties.getProperty("username"));
        dataSource.setPassword(properties.getProperty("password"));
        dataSource.setMaxActive(properties.getProperty("maxActive", Integer.class, 1));
        dataSource.setInitialSize(properties.getProperty("initialSize", Integer.class, 1));
        return dataSource;
    }

    @Bean
    public DataSourceTransactionManager transactionManager() {
        return new DataSourceTransactionManager(dataSource());
    }

    @Bean
    public SqlSessionFactory sqlSessionFactory() throws Exception {
        SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
        sessionFactory.setDataSource(dataSource());
        return sessionFactory.getObject();
    }
}
</code></pre>

<p>and the service codes snapshot is:</p>

<pre><code>@Override
    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
    public Map&lt;String, String&gt; productImport(Product product) throws Exception {
        .....
  }
</code></pre>

<p>Application.java is:</p>

<pre><code>@SpringBootApplication
public class Application extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(Application.class);
    }
}
</code></pre>

<p>build.gradle is:</p>

<pre><code>// Spring Boot MVC
compile("org.springframework.boot:spring-boot-starter-web")
// Spring Boot jdbc
compile("org.springframework.boot:spring-boot-starter-jdbc")
// Mybatis
compile("org.mybatis:mybatis:${mybatisVersion}")
compile("org.mybatis:mybatis-spring:${mybatisSpringVersion}")
</code></pre>

<p>I used spring + mybatis before and the @Transactional annotation worked well, but when I changed to spring-boot it doesn't work...</p>

<p>Any help or ideas would be greatly appreciated, Thanks in advance!</p>