title: Transaction rollback in SSM framework problem
body: <p>software version :jdk 8 spring 4.0 mybatis-3.2.7.jar mybatis-spring-1.2.2.jar ojdbc6.jar oracle 11g
  applicationContext.xml:</p>
  
  <pre><code>&lt;context:property-placeholder location="classpath:jdbc.properties" /&gt;
  &lt;bean class="org.springframework.jdbc.datasource.DriverManagerDataSource"
      id="dataSource"&gt;
      &lt;property name="url" value="${jdbc.url}"&gt;&lt;/property&gt;
      &lt;property name="driverClassName" value="${jdbc.driverClassName}"&gt;&lt;/property&gt;
      &lt;property name="username" value="${jdbc.username}"&gt;&lt;/property&gt;
      &lt;property name="password" value="${jdbc.password}"&gt;&lt;/property&gt;
  &lt;/bean&gt;
  &lt;bean id="appTransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"&gt;
    &lt;property name="dataSource" ref="dataSource" /&gt;
  &lt;/bean&gt;
  &lt;tx:annotation-driven transaction-manager="appTransactionManager" /&gt;
  </code></pre>
  
  <p>junit code:</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @TransactionConfiguration(transactionManager = "appTransactionManager", defaultRollback = true)
  @Transactional(rollbackFor = Exception.class)
  @ContextConfiguration("classpath:applicationContext.xml")
  public class GenerateJylshTest {
      @Test
      @Rollback(true)
      public void generateJylshTest() {
  
          String jyjgbh = "4201000000";
          GenerateJylsh generator = new GenerateJylsh();
          int i;
          for(i = 0;i &lt; 3;i++) {
              String jylshString = generator.generateJylsh(jyjgbh);
              System.out.println(jylshString);
          }
          int k = 1/0;
      }
  }
  </code></pre>
  
  <p>console result:</p>
  
  <pre><code>Creating a new SqlSession
  Registering transaction synchronization for SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@c7ba306]
  JDBC Connection [oracle.jdbc.driver.T4CConnection@172b013] will be managed by Spring
  ==&gt;  Preparing: SELECT * FROM BIZ_VEH_IS_TEMP_FLOWNUM t WHERE t.JCZ = ? AND t.JCXDM = ? 
  ==&gt; Parameters: 4201000000(String), 42010000001(String)
  &lt;==    Columns: JCZ, JCXDM, LSH
  &lt;==        Row: 4201000000, 42010000001, 01000019110800027
  &lt;==      Total: 1
  Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@c7ba306]
  Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@c7ba306] from current transaction
  ==&gt;  Preparing: UPDATE BIZ_VEH_IS_TEMP_FLOWNUM SET LSH = ? WHERE JCZ = ? AND JCXDM = ? 
  ==&gt; Parameters: 01000019110800028(String), 4201000000(String), 42010000001(String)
  &lt;==    Updates: 1
  Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@c7ba306]
  01000019110800028
  Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@c7ba306] from current transaction
  ==&gt;  Preparing: SELECT * FROM BIZ_VEH_IS_TEMP_FLOWNUM t WHERE t.JCZ = ? AND t.JCXDM = ? 
  ==&gt; Parameters: 4201000000(String), 42010000001(String)
  &lt;==    Columns: JCZ, JCXDM, LSH
  &lt;==        Row: 4201000000, 42010000001, 01000019110800028
  &lt;==      Total: 1
  Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@c7ba306]
  Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@c7ba306] from current transaction
  ==&gt;  Preparing: UPDATE BIZ_VEH_IS_TEMP_FLOWNUM SET LSH = ? WHERE JCZ = ? AND JCXDM = ? 
  ==&gt; Parameters: 01000019110800029(String), 4201000000(String), 42010000001(String)
  &lt;==    Updates: 1
  Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@c7ba306]
  01000019110800029
  Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@c7ba306] from current transaction
  ==&gt;  Preparing: SELECT * FROM BIZ_VEH_IS_TEMP_FLOWNUM t WHERE t.JCZ = ? AND t.JCXDM = ? 
  ==&gt; Parameters: 4201000000(String), 42010000001(String)
  &lt;==    Columns: JCZ, JCXDM, LSH
  &lt;==        Row: 4201000000, 42010000001, 01000019110800029
  &lt;==      Total: 1
  Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@c7ba306]
  Fetched SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@c7ba306] from current transaction
  ==&gt;  Preparing: UPDATE BIZ_VEH_IS_TEMP_FLOWNUM SET LSH = ? WHERE JCZ = ? AND JCXDM = ? 
  ==&gt; Parameters: 01000019110800030(String), 4201000000(String), 42010000001(String)
  &lt;==    Updates: 1
  Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@c7ba306]
  01000019110800030
  
  Transaction synchronization rolling back SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@c7ba306]
  Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@c7ba306]
  
  
  
  2019-11-08 16:31:09 [main] - [ INFO ]  Rolled back transaction after test execution for test context [DefaultTestContext@f316aeb testClass = GenerateJylshTest, testInstance = test.GenerateJylshTest@6aa3a905, testMethod = generateJylshTest@GenerateJylshTest, testException = java.lang.RuntimeException, mergedContextConfiguration = [MergedContextConfiguration@a22cb6a testClass = GenerateJylshTest, locations = '{classpath:applicationContext.xml}', classes = '{}', contextInitializerClasses = '[]', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]]
  
  2019-11-08 16:31:09 [Thread-1] - [ INFO ]  Closing org.springframework.context.support.GenericApplicationContext@4667ae56: startup date [Fri Nov 08 16:31:05 CST 2019]; root of context hierarchy
  </code></pre>
  
  <p>I used to think that this result code</p>
  
  <pre><code>Transaction synchronization rolling back SqlSession 
  Transaction synchronization closing SqlSession 
  </code></pre>
  
  <p>means the transaction rollback is already done,but the fact is data still update to the oracle database.
  So,I want to konw why.Thanks for any help.</p>