Skip to content

Commit a549825

Browse files
authored
Merge pull request Snailclimb#2237 from 843294669/patch-1
Update spring-knowledge-and-questions-summary.md
2 parents 0cbe171 + 26de544 commit a549825

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/system-design/framework/spring/spring-knowledge-and-questions-summary.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,8 @@ public class GlobalExceptionHandler {
555555

556556
### Spring 管理事务的方式有几种?
557557

558-
- **编程式事务**:在代码中硬编码(不推荐使用) : 通过 `TransactionTemplate`或者 `TransactionManager` 手动管理事务,实际应用中很少使用,但是对于你理解 Spring 事务管理原理有帮助
559-
- **声明式事务**:在 XML 配置文件中配置或者直接基于注解(推荐使用: 实际是通过 AOP 实现(基于`@Transactional` 的全注解方式使用最多)
558+
- **编程式事务**:在代码中硬编码(在分布式系统中推荐使用) : 通过 `TransactionTemplate`或者 `TransactionManager` 手动管理事务,事务范围过大会出现事务未提交导致超时,因此事务要比锁的粒度更小
559+
- **声明式事务**:在 XML 配置文件中配置或者直接基于注解(单体应用或者简单业务系统推荐使用: 实际是通过 AOP 实现(基于`@Transactional` 的全注解方式使用最多)
560560

561561
### Spring 事务中哪几种事务传播行为?
562562

0 commit comments

Comments
 (0)