Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
horaoen committed Oct 31, 2024
1 parent 8146634 commit 91bcc1e
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
6 changes: 6 additions & 0 deletions content/posts/CLI.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
title = "CLI"
date = "2024-10-15"
+++

1. 网络带宽测试工具 speedtest-cli
14 changes: 14 additions & 0 deletions content/posts/dm-migrate.md
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
11 changes: 11 additions & 0 deletions content/posts/spring-boot-usage.md
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
```
41 changes: 41 additions & 0 deletions content/posts/spring.md
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;
}
```

0 comments on commit 91bcc1e

Please sign in to comment.