召唤前辈.mybaits事务问题

事务貌似没有生效,后面出错了也不回滚,日志如下:

2012-07-08 17:11:04,998 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Creating SqlSession with JDBC Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@9fe84e]
2012-07-08 17:11:04,998 [main] DEBUG java.sql.Connection - ooo Connection Opened
2012-07-08 17:11:05,030 [main] DEBUG org.mybatis.spring.transaction.SpringManagedTransaction - JDBC Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@9fe84e] will not be managed by Spring
2012-07-08 17:11:05,030 [main] DEBUG org.mybatis.spring.SqlSessionUtils - SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1c20eb7] was not registered for synchronization because synchronization is not active
2012-07-08 17:11:05,170 [main] DEBUG java.sql.PreparedStatement - ==> Executing: select * from user where user_id=? 
2012-07-08 17:11:05,170 [main] DEBUG java.sql.PreparedStatement - ==> Parameters: 1(Integer)
2012-07-08 17:11:05,202 [main] DEBUG java.sql.ResultSet - <== Columns: user_id, login_name
2012-07-08 17:11:05,202 [main] DEBUG java.sql.ResultSet - <== Row: 1, zhangsan
2012-07-08 17:11:05,217 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Closing no transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@1c20eb7]
2012-07-08 17:11:05,217 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Creating SqlSession with JDBC Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@13d1402]
2012-07-08 17:11:05,217 [main] DEBUG java.sql.Connection - ooo Connection Opened
2012-07-08 17:11:05,217 [main] DEBUG org.mybatis.spring.transaction.SpringManagedTransaction - JDBC Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@13d1402] will not be managed by Spring
2012-07-08 17:11:05,217 [main] DEBUG org.mybatis.spring.SqlSessionUtils - SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@14b6b02] was not registered for synchronization because synchronization is not active
2012-07-08 17:11:05,264 [main] DEBUG java.sql.PreparedStatement - ==> Executing: update user set version = version + 1 where user_id = ? 
2012-07-08 17:11:05,264 [main] DEBUG java.sql.PreparedStatement - ==> Parameters: 1(Integer)
2012-07-08 17:11:05,295 [main] DEBUG org.mybatis.spring.SqlSessionUtils - Closing no transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@14b6b02]


配置是这样的:


  <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
     <property name="dataSource" ref="dataSource"/>
  </bean>

<bean id="transactionManager"      class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
     <property name="dataSource" ref="dataSource" />
  </bean>

java代码:

@Transactional
public void doAccount(Bean b) throws Exception{
  User user = userMapper.selectUserByUserId(b.getUserId());
  ...
  userMapper.updateUserAccount(b);
  ...
  if(paymentMapper.insertPayment(b) != 1){
throw new Exception();
  } 

}

目前的测试是到paymentMapper.insertPayment这里抛了异常,数据并没有进去.但是之前的update数据却没有回滚.以前没有用过mybaits不太了解.忘大神相助.
问题补充
主要是这句话是什么情况看不懂:
[main] DEBUG org.mybatis.spring.SqlSessionUtils - Closing no transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@b799cf]

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问