事务传播行为七种全背没用,REQUIRES_NEW 和 NESTED 回滚差异是考点
给组里转正前的校招生做 mock 面试,问到事务传播行为,他把七种背得一字不差,连英文单词的顺序都没错。我接着问:REQUIRES_NEW 的内层事务提交之后,外层回滚了,内层的数据还在吗?换成 NESTED 呢?他愣了十秒。背诵和理解的距离,就是这一问。
REQUIRES_NEW用多了,连接池为什么先炸?
很多人拿 REQUIRES_NEW 补锅,最后为什么先把连接池打满了?1. 事故现场:线程先全卡在拿连接上很多团队第一次大面积用 REQUIRES_NEW,都是想让局部动作独立提交。比如主流程失败也要记审计日志,主订单失败也要落补偿记录。
Spring 事务传播级别 REQUIRED 和 REQUIRES_NEW 的区别与选择
上线后第二天,运营反馈一条订单状态没更新,查日志发现异常明明抛了,数据库却纹丝不动。@Transactional 也加了,回滚就是没生效。
REQUIRES_NEW挂起的不只是连接,还有6个ThreadLocal
很多人理解 REQUIRES_NEW 传播行为,就一句话:"开个新事务。"但面试官追问一句"那旧事务怎么处理的?",基本答不上来。答案是:旧事务被挂起(suspend)了。
Understanding China's 'two sessions' requires more than translation
Lead: Western coverage of China's “two sessions” often mistakes translation for understanding. The two are not the same thing.
“只有中国帮我们!”意大利大使批欧盟:我们求助了,竟无一国响应 | 外媒说
ButRome should not be left to handle this crisis alone. In addition to national measures, this is a crisis that requires a global and — firs
英译汉:It requires a variety of skills to enter a different profession
一、较难单词1. designing /dɪˈzaɪnɪŋ/ n. 设计2. creative /kriˈeɪtɪv/ adj. 有创造力的3. latest /ˈleɪtɪst/ adj. 最新的4. fashion /ˈfæʃn/ n. 时尚;时装5.
Code of conduct requires sincerity to finalize
: China Daily editorial - Opinion - Chinadaily.com.cn。The 48th Summit of the Association of Southeast Asian Nations concluded in Cebu, the Philippines, last week with the release of a statement underscoring the need for a Code of Conduct in the South China Sea grounded in international law.
REQUIRES_NEW上线,连接池先崩了
周五下午两点,订单服务突然没有任何响应。不是报500,不是抛异常,是整个服务像被按了暂停键——所有请求进来就挂起,超时后连接断开。翻遍日志,最后一条正常记录停在14:03,后面是连续的超时告警。没有OOM,没有死锁日志,GC也正常。重启,恢复。十分钟后,又卡死了。