日志记录回滚,数据未回滚,表是innodb 
日志如下SqlMapClientTemplate - Opened SqlMapSession [com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl@62ca7420] for iBATIS operation
Connection - {conn-100012} Connection
SqlMapClientTemplate - Obtained JDBC Connection [Transaction-aware proxy for target Connection  from DataSource [com.p6spy.engine.spy.P6DataSource@3b91cfd7]] for iBATIS operation
Connection - {conn-100012} Preparing Statement:      update tb_receipt    set         receipt_distribute_id = ?        ,     receipt_type = ?        ,     receipt_no = ?        ,     receipt_deleted = ?        ,     receipt_state = ?                    ,     receipt_invalid_type = ?                                                where receipt_id = ?   
GooGooStatementCache - cxnStmtMgr.statementSet( com.p6spy.engine.logging.P6LogConnection@b9c5ca ).size(): 5
GooGooStatementCache - checkoutStatement: com.mchange.v2.c3p0.stmt.PerConnectionMaxOnlyStatementCache stats -- total size: 5; checked out: 1; num connections: 1; num keys: 5
PreparedStatement - {pstm-100013} Executing Statement:      update tb_receipt    set         receipt_distribute_id = ?        ,     receipt_type = ?        ,     receipt_no = ?        ,     receipt_deleted = ?        ,     receipt_state = ?                    ,     receipt_invalid_type = ?                                                where receipt_id = ?   
PreparedStatement - {pstm-100013} Parameters: [d0f81e553c3d4ae487b7715cb4313068, 4, 100015, 0, 1, 0, ba0a9ba487b24caf9f6f1a7dfdf19749]
PreparedStatement - {pstm-100013} Types: [java.lang.String, java.lang.Integer, java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String]
2012-09-19 11:04:27,089|55|0|statement|     update tb_receipt    set         receipt_distribute_id = ?        ,     receipt_type = ?        ,     receipt_no = ?        ,     receipt_deleted = ?        ,     receipt_state = ?                    ,     receipt_invalid_type = ?                                                where receipt_id = ?   |     update tb_receipt    set         receipt_distribute_id = 'd0f81e553c3d4ae487b7715cb4313068'        ,     receipt_type = 4        ,     receipt_no = '100015'        ,     receipt_deleted = 0        ,     receipt_state = 1                    ,     receipt_invalid_type = 0                                                where receipt_id = 'ba0a9ba487b24caf9f6f1a7dfdf19749'   
2012-09-19 11:04:27,089|55|3|statement|     update tb_receipt    set         receipt_distribute_id = ?        ,     receipt_type = ?        ,     receipt_no = ?        ,     receipt_deleted = ?        ,     receipt_state = ?                    ,     receipt_invalid_type = ?                                                where receipt_id = ?   |     update tb_receipt    set         receipt_distribute_id = 'd0f81e553c3d4ae487b7715cb4313068'        ,     receipt_type = 4        ,     receipt_no = '100015'        ,     receipt_deleted = 0        ,     receipt_state = 1                    ,     receipt_invalid_type = 0                                                where receipt_id = 'ba0a9ba487b24caf9f6f1a7dfdf19749'   
GooGooStatementCache - checkinStatement(): com.mchange.v2.c3p0.stmt.PerConnectionMaxOnlyStatementCache stats -- total size: 5; checked out: 0; num connections: 1; num keys: 5
DataSourceUtils - Returning JDBC Connection to DataSource
GooGooStatementCache - checkinAll(): com.mchange.v2.c3p0.stmt.PerConnectionMaxOnlyStatementCache stats -- total size: 5; checked out: 0; num connections: 1; num keys: 5
BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@79ea93ee [managed: 5, unused: 3, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@326082c2)
DataSourceTransactionManager - Initiating transaction rollback
DataSourceTransactionManager - Rolling back JDBC transaction on Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@5e532acb]
GooGooStatementCache - checkinAll(): com.mchange.v2.c3p0.stmt.PerConnectionMaxOnlyStatementCache stats -- total size: 5; checked out: 0; num connections: 1; num keys: 5
2012-09-19 11:04:27,099|3|1|rollback||
DataSourceTransactionManager - Releasing JDBC Connection [com.mchange.v2.c3p0.impl.NewProxyConnection@5e532acb] after transaction
DataSourceUtils - Returning JDBC Connection to DataSource
GooGooStatementCache - checkinAll(): com.mchange.v2.c3p0.stmt.PerConnectionMaxOnlyStatementCache stats -- total size: 5; checked out: 0; num connections: 1; num keys: 5
BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@79ea93ee [managed: 5, unused: 4, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@326082c2)
GooGooStatementCache - checkinAll(): com.mchange.v2.c3p0.stmt.PerConnectionMaxOnlyStatementCache stats -- total size: 5; checked out: 0; num connections: 1; num keys: 5
java.lang.RuntimeException
at com.juren.business.module.finance.service.impl.FinanceService.validateReceiptCode(FinanceService.java:809)
at com.juren.business.module.finance.service.impl.FinanceService.addFinanceForRegist
AnnotationMethodHandlerAdapter - Written [com.juren.tools.JsonResponse@108b60a0] as "application/json;charset=UTF-8" using [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter@2e74b0dc]
DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'springmvc': assuming HandlerAdapter completed request handling
DispatcherServlet - Successfully completed request方法如下:
由于该方法是公共方法需要被调用所以设置propagation=Propagation.MANDATORY,调用此方法的方法 设置Propagation.REQUIRED @Transactional(propagation=Propagation.MANDATORY,rollbackFor=Exception.class,readOnly=false)
private  Receipt validateReceiptCode(String receiptCode,Integer type) throws Exception{

if(StringUtils.isBlank(receiptCode))return null;
List<Receipt> receiptList = receiptDao.findByMap(new String[]{"receiptNo","receiptDeleted","receiptState","receiptType"}, new Object[]{receiptCode,0,0,type}, null, null);
if(receiptList.size()<=0)
  return null;
Receipt rec = receiptList.get(0);
rec.setReceiptState(1);
receiptDao.update(rec);
if(true) throw new RuntimeException();
return rec;
}spring 配置
<!-- 使用annotation定义事务 -->
<tx:annotation-driven transaction-manager="transactionManager" />

<!-- 使用annotation 自动注册bean,并保证@Required,@Autowired的属性被注入 -->
<context:component-scan base-package="com.juren">
<context:include-filter type="regex" expression=".*Dao"/>
<context:include-filter type="regex" expression=".*Service" />
</context:component-scan>