title: transactionTemplate doesn't work with mybatis but I don't know why
body: <p>I'm trying to using transactionTemplate to manage my transaction. The code may list as below:</p>
  
  <pre><code>private Boolean isCleanSuccess(){
      return transactionTemplate.execute(new TransactionCallback&lt;Boolean&gt;() {
          @Override
          public Boolean doInTransaction(TransactionStatus transactionStatus) {
              String rmcName = "sync";
              StringBuilder sbSync = new StringBuilder();
              sbSync.append("delete from `t_sync_data_plan` WHERE 1=1");
              StringBuilder sbRmc = new StringBuilder();
              sbRmc.append("delete from `t_rmc_data` where `name`=\"")
                      .append(rmcName)
                      .append("\"");
              try{
                  jdbcTemplate.execute(sbSync.toString());
                  jdbcTemplate.execute(sbRmc.toString());
                  /**
                    * throw the exception to make it rollback
                    */
                  // throw new RuntimeException();
                  return true;
              }catch (Exception ex){
                  LOG.error(ex);
                  transactionStatus.setRollbackOnly();
                  return false;
              }
          }
      });
  }
  </code></pre>
  
  <p>When I deal with Dao by using jdbcTemplate, it works. However, it just can not rollback if I throw the Exception when I use myBatis. The XML code lists as below:</p>
  
  <pre><code>&lt;!-- rest transaction --&gt;
  &lt;bean id="restTransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt;
      &lt;property name="dataSource" ref="restDataSource"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="restTransactionTemplate" name="restTransactionTemplate" class="org.springframework.transaction.support.TransactionTemplate"&gt;
      &lt;property name="transactionManager" ref="restTransactionManager"/&gt;
  &lt;/bean&gt;
  
   &lt;!--domain transacation--&gt;
  &lt;bean id="domainTransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt;
      &lt;property name="dataSource" ref="domainDataSource"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="domainTransactionTemplate" name="domainTransactionTemplate" class="org.springframework.transaction.support.TransactionTemplate"&gt;
      &lt;property name="transactionManager"&gt;
          &lt;ref bean="domainTransactionManager"/&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;!-- multi-datasource config --&gt;
  &lt;bean id="multipleDataSource" class="com.angho.rest.db.MultipleDataSource" init-method="init"&gt;
      &lt;property name="defaultTargetDataSource" ref="restDataSource"/&gt;
      &lt;property name="targetDataSources"&gt;
          &lt;map&gt;
              &lt;entry key="restDataSource" value-ref="restDataSource"/&gt;
              &lt;entry key="domainDataSource" value-ref="domainDataSource"/&gt;
          &lt;/map&gt;
      &lt;/property&gt;
      &lt;property name="baseDaoDir" value="com.angho.rest"/&gt;
      &lt;property name="dataSourceNameMap"&gt;
          &lt;map&gt;
              &lt;entry key="dao" value="restDataSource"/&gt;
              &lt;entry key="dao2" value="domainDataSource"/&gt;
          &lt;/map&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"&gt;
      &lt;property name="dataSource" ref="multipleDataSource" /&gt;
      &lt;property name="configLocation" value="classpath:/mybatis-config.xml"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I don't know why the rollback just works under jdbcTemplate but loses efficacy under mybatis. The engine of table is InnoDB.
  Could you please give me a hand?It has been puzzled me for nearly two weeks. 
  Sorry for the inconvenience that my poor English brought.</p>