Spring3开发实战 之 第五章:Spring中的事务(二)

2014-11-24 08:36:44 · 作者: · 浏览: 2
www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">


















oracle.jdbc.driver.OracleDriver


jdbc:oracle:thin:@localhost:1521:orcl

ztb




事务回滚:可以在配置中指定需要回滚的Exception,如下:

java代码:
查看复制到剪贴板打印


rollback-for="NoProductInStockException"/>



有关的设置,默认的 设置如下:
1:事务传播设置是 REQUIRED www.2cto.com
2:隔离级别是 DEFAULT
3:事务是 读/写
4:事务超时默认是依赖于事务系统的,或者事务超时没有被支持。
5:任何 RuntimeException 将触发事务回滚,但是任何 checked Exception 将不触发事务回滚

作者:jinnianshilongnian