惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
Docker
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
C
Check Point Blog
腾讯CDC
Stack Overflow Blog
Stack Overflow Blog
V
Visual Studio Blog
IT之家
IT之家
月光博客
月光博客
U
Unit 42
K
Kaspersky official blog
T
Threatpost
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
GbyAI
GbyAI
P
Proofpoint News Feed
Last Week in AI
Last Week in AI
云风的 BLOG
云风的 BLOG
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
Engineering at Meta
Engineering at Meta
Recorded Future
Recorded Future
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Security @ Cisco Blogs
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
Security Archives - TechRepublic
Security Archives - TechRepublic
Webroot Blog
Webroot Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hacker News - Newest:
Hacker News - Newest: "LLM"
S
Schneier on Security
S
Secure Thoughts
The Register - Security
The Register - Security
B
Blog RSS Feed
The Last Watchdog
The Last Watchdog
P
Palo Alto Networks Blog
爱范儿
爱范儿
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
L
LINUX DO - 热门话题
C
Cisco Blogs
Spread Privacy
Spread Privacy
F
Full Disclosure
博客园 - 聂微东
T
The Blog of Author Tim Ferriss

博客园 - 那只狐狸

线程与GC 神奇的Task.WaitALl Redis的淘汰策略 压测工具k6 C#的Lock可以锁什么? SqlServer高性能批量插入 二叉树 二叉搜索树 AVL树 红黑树 关于GC 线上bug线下很难重现时的一次处理 自动化测试和联调的工具---apifox sleep、yield、wait的区别 线程异常 线程 JAVA线程中断 volatile synchronized在线程安全上的区别 jms amqp activemq rabbitmq的区别 servlet不是线程安全的 雪花算法 mysql在海量数据时的处理方案
事务管理思考
那只狐狸 · 2019-12-23 · via 博客园 - 那只狐狸

orm dao关心sql生成、参数绑定、结果映射

service层使用事务

事务管理的基础是基于同一个数据库链接;多线程公用一个数据库连接会发生回滚;不同线程使用不同的连接的办法是使用threadlocal;

spring是胶水层、提供的功能都是集成过来的;

理论是实践之后的产物

注解的核心是aop   cglib proxy

基于spring的aop @Enable,除了注解方式 患有xml配置的方式

@Aspect

public class MyTransactionAspect{

@Around("@anotation(Mytransaction)")   /@Before

public Object doTransactional(ProceedingJoinPoint p ){}

 .....

object o = p.proceed();

.....

}

框架也是逐步封装,所有技术都是演进的;封装的难点是多线程

aop把try{}catch、打开链接、关闭连接的代码提取出来了