摘要: 不废话直接上代码 @Service public class XXXService { // 这两个必须要注入 @Resource DataSourceTransactionManager dataSourceTransactionManager; @Resource TransactionDefi 阅读全文
posted @ 2022-08-09 11:07 卡文地洗 阅读(926) 评论(0) 推荐(0)
摘要: 先加一个配置。设置超时时间。 spring: mvc: async: request-timeout: 20 接口的方法返回参数必须是Callable @RestController public class TestController { @GetMapping("/test") public 阅读全文
posted @ 2022-04-26 10:13 卡文地洗 阅读(5094) 评论(0) 推荐(0)
摘要: 报错语句: delete from users where username in ( select username from users where enabled = 0 ) 解决办法: 修改子查询,多嵌套一层 delete from users where username in ( sel 阅读全文
posted @ 2022-04-24 13:53 卡文地洗 阅读(49) 评论(0) 推荐(0)
摘要: 饿汉式 public class Singleton{ //类加载时就初始化 private static final Singleton INSTANCE = new Singleton(); //构造方法必须私有 private Singleton(){} //提供获取对象的方法 public 阅读全文
posted @ 2020-11-04 10:28 卡文地洗 阅读(98) 评论(0) 推荐(0)
摘要: 写一个枚举类 public enum Gender { MALE("先生","mr"), FEMALE("女士","miss"); String chinese; String abbr; Gender(String chinese,String abbr){ this.chinese = chin 阅读全文
posted @ 2020-09-30 16:22 卡文地洗 阅读(7657) 评论(0) 推荐(0)
摘要: 新建一个maven项目 spring-boot-starter-diy <groupId>org.example</groupId><artifactId>diy-spring-boot-starter</artifactId><packaging>jar</packaging><version>1 阅读全文
posted @ 2020-09-23 17:25 卡文地洗 阅读(115) 评论(0) 推荐(0)
摘要: 1.原理 哨兵模式至少需要三台Redis服务器,分别是: Master、Slave 和 Sentinel Sentinel 是用来进行 Master 与 Slave 的监控,当 Master 挂的时候, Sentinel 会将 Slave 变更为 Master, 而原本挂的 Master 经过修复重 阅读全文
posted @ 2020-09-23 17:23 卡文地洗 阅读(1428) 评论(0) 推荐(0)