Propagation.NESTED解释:
内嵌事务依赖于外部事务;若内部事务发生异常则回滚至内部事务开始的位置,继续执行外部事务;若内部事务正常处理完,外部事务发生异常,则外部事务同内部事务一起回滚;
若内部事务正常处理完,则继续进行外部事务,等外部事务处理完,两者一起提交或者一起回滚。
事务的隔离级别:
READ_COMMITTED 锁定正在读取的行
REPEATABLE_READ 锁定读取的所有行
SERIALIZABLE 锁表
/**
* Use the default isolation level of the underlying datastore.
* All other levels correspond to the JDBC isolation levels.
* @see java.sql.Connection
*/
DEFAULT(TransactionDefinition.ISOLATION_DEFAULT),
/**
* A constant indicating that dirty reads, non-repeatable reads and phantom reads
* can occur. This level allows a row changed by one transaction to be read by
* another transaction before any changes in that row have been committed
* (a "dirty read"). If any of the changes are rolled back, the second
* transaction will have retrieved an invalid row.
* @see java.sql.Connection#TRANSACTION_READ_UNCOMMITTED
*/
READ_UNCOMMITTED(TransactionDefinition.ISOLATION_READ_UNCOMMITTED),
/**
* A constant indicating that dirty reads are prevented; non-repeatable reads
* and phantom reads can occur. This level only prohibits a transaction
* from reading a row with uncommitted changes in it.
* @see java.sql.Connection#TRANSACTION_READ_COMMITTED
*/
READ_COMMITTED(TransactionDefinition.ISOLATION_READ_COMMITTED),
/**
* A constant indicating that dirty reads and non-repeatable reads are
* prevented; phantom reads can occur. This level prohibits a transaction
* from reading a row with uncommitted changes in it, and it also prohibits
* the situation where one transaction reads a row, a second transaction
* alters the row, and the first transaction rereads the row, getting
* different values the second time (a "non-repeatable read").
* @see java.sql.Connection#TRANSACTION_REPEATABLE_READ
*/
REPEATABLE_READ(TransactionDefinition.ISOLATION_REPEATABLE_READ),
/**
* A constant indicating that dirty reads, non-repeatable reads and phantom
* reads are prevented. This level includes the prohibitions in
* <code>ISOLATION_REPEATABLE_READ</code> and further prohibits the situation
* where one transaction reads all rows that satisfy a <code>WHERE</code>
* condition, a second transaction inserts a row that satisfies that
* <code>WHERE</code> condition, and the first transaction rereads for the
* same condition, retrieving the additional "phantom" row in the second read.
* @see java.sql.Connection#TRANSACTION_SERIALIZABLE
*/
SERIALIZABLE(TransactionDefinition.ISOLATION_SERIALIZABLE);
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
TestSpring.rar (31个子文件)
TestSpring
.project 386B
src
x
y
service
FooService.java 332B
DefaultBarService.java 566B
Foo.java 304B
BarService.java 306B
DefaultFooService.java 1KB
snt
wyb
service
Service1Impl.java 1KB
TestIsolation.java 1KB
context.xml 2KB
I2Service.java 534B
Service2Impl.java 824B
I1Service.java 530B
TestIsolation.java 460B
context.xml 2KB
Required.java 469B
ReadMe.txt 3KB
.classpath 990B
bin
Required.class 1009B
x
y
service
DefaultFooService.class 2KB
FooService.class 424B
DefaultBarService.class 1004B
Foo.class 684B
BarService.class 374B
TestIsolation.class 849B
snt
wyb
service
Service1Impl.class 2KB
I1Service.class 491B
TestIsolation.class 1KB
Service2Impl.class 1KB
I2Service.class 495B
context.xml 2KB
context.xml 2KB
共 31 条
- 1
资源评论
- zyg3453827082013-09-16有参考价值,谢谢!!!
- 「已注销」2015-07-24有参考价值,只不过内容有点老旧了
- herofighter20082013-05-26大哥,能不能附带的把sql也放进去啊
- dreamly1234562014-07-23做下参考,还是可以的
- castcalla2016-05-17虽然现在都不用spring内置事务,但是作为学习可以看看
懒得搭理你
- 粉丝: 87
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功