1.spring管理的 自动 @Transaction() 声明式事务
@Transaction(rollback=Exception.class)
public synchronized void test(){
// 查询订单数量
queryProductCount();
// 判断订单是否>0
if(){
throw Exception();
}
// 更新库存
update();
// 插入一条订单数据
insert();
}
CountDownLatch countDownLatch = new CountDownLatch(1);
ExecutorService executorService &