摘要: 阅读全文
posted @ 2024-10-12 14:20 能。 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 原因:jdk11之后不支持druid的两个依赖 方法一: <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.2.5</version>方法二: <!-- <exclusions> 阅读全文
posted @ 2024-08-19 16:28 能。 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 抢购业务数据库需要考虑的点如下: 一、超卖现象 场景如下: 库存数是5。现在3个用户来购买,a用户购买2个,b用户购买3个,c用户购买1个。合起来就是准备购买6个。 如果三个用户是同时并发购买,会出现怎样的情况呢? 每个用户进行减库存的时候,语句类似于: 1 update goods set amo 阅读全文
posted @ 2024-08-15 11:23 能。 阅读(18) 评论(0) 推荐(0) 编辑
摘要: git revert 89ba2b4d39965b0913ca73b730246d617019126b -m 1 阅读全文
posted @ 2024-07-19 10:25 能。 阅读(5) 评论(0) 推荐(0) 编辑
摘要: @Configurationpublic class ThirdPartyOilSmallTaskConfig { @Bean("thirdPartyOilSmallTaskExecutor") public ThreadPoolTaskExecutor uniteOilThreadPoolTask 阅读全文
posted @ 2024-07-03 17:40 能。 阅读(19) 评论(0) 推荐(0) 编辑
摘要: public class FeignInterceptor implements RequestInterceptor { @Overridepublic void apply(RequestTemplate requestTemplate) { ServletRequestAttributes r 阅读全文
posted @ 2024-03-13 22:25 能。 阅读(75) 评论(0) 推荐(0) 编辑
摘要: /** * aop 防止并发请求 */@Slf4j@Aspect@Componentpublic class LimitRequestAspect { @Autowired RedisHelper redisHelper; @Around("@annotation(limitRequest)") p 阅读全文
posted @ 2024-01-22 18:05 能。 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 需要修改数据库binlog的格式 [mysqld] log-bin=mysql-bin # 开启 binlog binlog-format=ROW # 选择 ROW 模式 因为mysql 默认是statement,statement存的是sql语句,没变法显示数据 阅读全文
posted @ 2024-01-05 17:39 能。 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 耗时69秒 加上 rewriteBatchedStatements=true 瞬间执行完成! ps:rewriteBatchedStatements -> 等于sql层 insert多条,而saveBatch方法是 批量执行多条sql 阅读全文
posted @ 2023-12-26 17:09 能。 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 1.<update id="updateBatch" parameterType="java.util.List"> <foreach collection="list" item="item" index="index" separator=";"> UPDATE enterprise_oil_a 阅读全文
posted @ 2023-12-26 17:01 能。 阅读(1637) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示