更新 Java_3-5.md
This commit is contained in:
parent
67758ca8fa
commit
ebe79630e0
10
Java_3-5.md
10
Java_3-5.md
@ -110,5 +110,13 @@
|
||||
> 引导:假设一个请求中,有大量的写入sql,互相不耦合。将其拆成多个小事务,使用多线程执行为其提速,但是其中1个发生异常,则全部回滚。
|
||||
|
||||
<p style="color: green">
|
||||
使用Spring框架提供的事务同步器
|
||||
使用**TransactionTemplate**手动创建事务,并在线程上下文中记录事务状态。Spring的事务是绑定到ThreadLocal中的,如果某个线程的任务发生异常回滚,回滚所有线程的事务即可。
|
||||
</p>
|
||||
|
||||
### 问题6
|
||||
|
||||
<p style="color: red">已经存在的表添加联合系引的sql</p>
|
||||
|
||||
<p style="color: green">
|
||||
**CREATE INDEX 索引名称 ON 表名称 (创建联合索引的字段);**创建索引,需要结合查询字段的顺序,**遵循最左前缀原则。**
|
||||
</p>
|
||||
Loading…
Reference in New Issue
Block a user