摘要: 2023.8.31 try...catch...finally,如果有如下代码 public static void main(String[] args) { try { System.out.println(func1()); } catch (Exception e) { System.out 阅读全文
posted @ 2023-08-31 09:22 sellingpear 阅读(20) 评论(0) 推荐(0)
摘要: 2023.8.31 1.该关键字是可以保证有序性的,也就是禁止重排 2024.6.12 1.不会阻塞 2.不能保证原子性 3.如有改动对各个线程立即可见 4.因为不是每次改动都生效,所以不能仅依赖它实现计数锁 阅读全文
posted @ 2023-08-31 00:32 sellingpear 阅读(18) 评论(0) 推荐(0)
摘要: 2023.8.31 1.事务的传播依靠ThreadLocal线程副本 2.PROPAGATION_REQUIRED:如果当前没有事务,就新建一个事务,如果已经存在一个事务中,加入到这个事务中。这是最常见的选择。(默认的) 3.PROPAGATION_REQUIRES_NEW:新建事务,如果当前存在事 阅读全文
posted @ 2023-08-31 00:30 sellingpear 阅读(33) 评论(0) 推荐(0)