Skip to content

Commit 232ae9b

Browse files
authored
Merge pull request Snailclimb#1371 from weixsun/Update-Spring事务总结
Update Spring事务总结.md
2 parents 614a292 + 9b358a9 commit 232ae9b

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

docs/system-design/framework/spring/Spring事务总结.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ InnoDB 存储引擎在 **分布式事务** 的情况下一般会用到 **SERIALI
513513

514514
所谓事务超时,就是指一个事务所允许执行的最长时间,如果超过该时间限制但事务还没有完成,则自动回滚事务。在 `TransactionDefinition` 中以 int 的值来表示超时时间,其单位是秒,默认值为-1。
515515

516-
#### 3.3.3. 事务只读属性
516+
#### 3.3.4. 事务只读属性
517517

518518
```java
519519
package org.springframework.transaction;
@@ -545,7 +545,7 @@ public interface TransactionDefinition {
545545
1. 如果你一次执行单条查询语句,则没有必要启用事务支持,数据库默认支持 SQL 执行期间的读一致性;
546546
2. 如果你一次执行多条查询语句,例如统计查询,报表查询,在这种场景下,多条查询 SQL 必须保证整体的读一致性,否则,在前条 SQL 查询之后,后条 SQL 查询之前,数据被其他用户改变,则该次整体的统计查询将会出现读数据不一致的状态,此时,应该启用事务支持
547547

548-
#### 3.3.4. 事务回滚规则
548+
#### 3.3.5. 事务回滚规则
549549

550550
这些规则定义了哪些异常会导致事务回滚而哪些不会。默认情况下,事务只有遇到运行期异常(RuntimeException 的子类)时才会回滚,Error 也会导致事务回滚,但是,在遇到检查型(Checked)异常时不会回滚。
551551

@@ -601,7 +601,7 @@ public @interface Transactional {
601601
}
602602
```
603603

604-
**`@Transactional` 的常用配置参数总结(只列巨额 5 个我平时比较常用的):**
604+
**`@Transactional` 的常用配置参数总结(只列出了 5 个我平时比较常用的):**
605605

606606
| 属性名 | 说明 |
607607
| :---------- | :------------------------------------------------------------------------------------------- |
@@ -681,10 +681,17 @@ private void method1() {
681681

682682
## 4. Reference
683683

684-
3. [总结]Spring 事务管理中@Transactional 的参数:[http://www.mobabel.net/spring 事务管理中 transactional 的参数/](http://www.mobabel.net/spring事务管理中transactional的参数/)
685-
4. Spring 官方文档:[https://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/transaction.html](https://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/transaction.html)
686-
5. 《Spring5 高级编程》
687-
6. 透彻的掌握 Spring 中@transactional 的使用: [https://www.ibm.com/developerworks/cn/java/j-master-spring-transactional-use/index.html](https://www.ibm.com/developerworks/cn/java/j-master-spring-transactional-use/index.html)
688-
7. Spring 事务的传播特性:[https://github.com/love-somnus/Spring/wiki/Spring 事务的传播特性](https://github.com/love-somnus/Spring/wiki/Spring事务的传播特性)
689-
8. [Spring 事务传播行为详解](https://segmentfault.com/a/1190000013341344)[https://segmentfault.com/a/1190000013341344](https://segmentfault.com/a/1190000013341344)
690-
9. 全面分析 Spring 的编程式事务管理及声明式事务管理:[https://www.ibm.com/developerworks/cn/education/opensource/os-cn-spring-trans/index.html](https://www.ibm.com/developerworks/cn/education/opensource/os-cn-spring-trans/index.html)
684+
1. [总结]Spring 事务管理中@Transactional 的参数:[http://www.mobabel.net/spring 事务管理中 transactional 的参数/](http://www.mobabel.net/spring事务管理中transactional的参数/)
685+
686+
2. Spring 官方文档:[https://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/transaction.html](https://docs.spring.io/spring/docs/4.2.x/spring-framework-reference/html/transaction.html)
687+
688+
3. 《Spring5 高级编程》
689+
690+
4. 透彻的掌握 Spring 中@transactional 的使用: [https://www.ibm.com/developerworks/cn/java/j-master-spring-transactional-use/index.html](https://www.ibm.com/developerworks/cn/java/j-master-spring-transactional-use/index.html)
691+
692+
5. Spring 事务的传播特性:[https://github.com/love-somnus/Spring/wiki/Spring 事务的传播特性](https://github.com/love-somnus/Spring/wiki/Spring事务的传播特性)
693+
694+
6. [Spring 事务传播行为详解](https://segmentfault.com/a/1190000013341344)[https://segmentfault.com/a/1190000013341344](https://segmentfault.com/a/1190000013341344)
695+
696+
7. 全面分析 Spring 的编程式事务管理及声明式事务管理:[https://www.ibm.com/developerworks/cn/education/opensource/os-cn-spring-trans/index.html](https://www.ibm.com/developerworks/cn/education/opensource/os-cn-spring-trans/index.html)
697+

0 commit comments

Comments
 (0)