-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
+++ | ||
title = "CLI" | ||
date = "2024-10-15" | ||
+++ | ||
|
||
1. 网络带宽测试工具 speedtest-cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
+++ | ||
title = "达梦数据库迁移" | ||
date = "2024-10-28" | ||
+++ | ||
|
||
# 环境 | ||
1. 客户端:macos使用dbeaver, IDEA: 使用mysql连接修改驱动使用达梦数据库连接驱动 | ||
# 函数 | ||
1. str_to_date => to_date(date1, 'YYYY-MM-DD HH24:MI:SS') | ||
2. group_concat => wm_concat / listagg | ||
3. date_sub => add_days / add_months | ||
4. current_time => current_date() / sysdate() / curdate() | ||
5. date(var) => trunc(var) | ||
6. convert => cast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
+++ | ||
title = "springboot usage" | ||
date = "2024-10-30" | ||
+++ | ||
|
||
1. jdbcTemplate配置sql日志打印 | ||
```yaml | ||
logging: | ||
level: | ||
org.springframework.jdbc.core.JdbcTemplate: DEBUG | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
+++ | ||
title = "spring" | ||
date = "2024-10-15" | ||
+++ | ||
|
||
# Bean 缓存 | ||
|
||
```java | ||
@Nullable | ||
protected Object getSingleton(String beanName, boolean allowEarlyReference) { | ||
// 查询一级缓存 | ||
Object singletonObject = this.singletonObjects.get(beanName); | ||
// 如果一级缓存不存在且当前 bean 正在创建 | ||
if (singletonObject == null && isSingletonCurrentlyInCreation(beanName)) { | ||
// 查询二级缓存 | ||
singletonObject = this.earlySingletonObjects.get(beanName); | ||
// 如果二级缓存不存在且允许提前引用 | ||
if (singletonObject == null && allowEarlyReference) { | ||
synchronized (this.singletonObjects) { | ||
// Consistent creation of early reference within full singleton lock | ||
// 一级缓存重新获取 | ||
singletonObject = this.singletonObjects.get(beanName); | ||
if (singletonObject == null) { | ||
// 二级缓存重新获取 | ||
singletonObject = this.earlySingletonObjects.get(beanName); | ||
if (singletonObject == null) { | ||
// 三级缓存获取 | ||
ObjectFactory<?> singletonFactory = this.singletonFactories.get(beanName); | ||
if (singletonFactory != null) { | ||
singletonObject = singletonFactory.getObject(); | ||
this.earlySingletonObjects.put(beanName, singletonObject); | ||
this.singletonFactories.remove(beanName); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
return singletonObject; | ||
} | ||
``` |