From f39b5212f7383c8efb86a1bfff6ac0f697f95443 Mon Sep 17 00:00:00 2001 From: yewj Date: Sat, 22 Mar 2025 23:27:34 +0800 Subject: [PATCH] =?UTF-8?q?oceanbase=E6=95=B0=E6=8D=AE=E5=BA=93=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 14 ++++++++-- .../com/glxp/api/config/HdSchemaExecutor.java | 4 +-- src/main/resources/application-dev.yml | 27 +++++++++++++------ src/main/resources/application-pro.yml | 2 +- src/main/resources/application.yml | 4 +-- 5 files changed, 36 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index 530089561..26b501e96 100644 --- a/pom.xml +++ b/pom.xml @@ -117,13 +117,23 @@ pom + + com.oceanbase + oceanbase-client + 2.4.0 + + com.baomidou mybatis-plus-boot-starter 3.5.2 - + + com.github.pagehelper + pagehelper + 5.3.0 + com.github.pagehelper @@ -196,7 +206,7 @@ com.github.pagehelper pagehelper-spring-boot-autoconfigure - 1.4.5 + 1.4.2 org.springframework.boot diff --git a/src/main/java/com/glxp/api/config/HdSchemaExecutor.java b/src/main/java/com/glxp/api/config/HdSchemaExecutor.java index 061da469f..a00d47101 100644 --- a/src/main/java/com/glxp/api/config/HdSchemaExecutor.java +++ b/src/main/java/com/glxp/api/config/HdSchemaExecutor.java @@ -18,8 +18,8 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; -@Order(1) -@Component +//@Order(1) +//@Component @Slf4j public class HdSchemaExecutor implements ApplicationRunner { diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 6524e6bd2..33a2ad188 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -3,16 +3,27 @@ server: spring: datasource: - driver-class-name: com.p6spy.engine.spy.P6SpyDriver - jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_wms_cl?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true - username: root + driver-class-name: com.alipay.oceanbase.jdbc.Driver + jdbc-url: jdbc:oceanbase://192.168.110.129:2881/udi_wms?socketTimeout=60000&connectTimeout=10000&autoReconnect=true&failOverReadOnly=false&maxReconnects=3&tcpKeepAlive=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + username: sjld password: 123456 hikari: - connection-timeout: 60000 - maximum-pool-size: 20 - minimum-idle: 10 - - + # 增加连接有效性检查 + connection-test-query: SELECT 1 FROM DUAL + # 减少验证超时时间 + validation-timeout: 5000 + # 增加最大连接数 + maximum-pool-size: 15 + # 调整最小空闲连接数,保持更多活跃连接 + minimum-idle: 8 + # 延长空闲超时 + idle-timeout: 900000 # 15分钟 + # 延长最大生命周期 + max-lifetime: 3600000 # 1小时 + # OceanBase可能需要更长的连接超时时间 + connection-timeout: 60000 # 60秒 + # 使用自动提交 + auto-commit: true redis: database: 8 host: 127.0.0.1 diff --git a/src/main/resources/application-pro.yml b/src/main/resources/application-pro.yml index 6d02a17f9..a15eeb00a 100644 --- a/src/main/resources/application-pro.yml +++ b/src/main/resources/application-pro.yml @@ -3,7 +3,7 @@ server: spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - jdbc-url: jdbc:mysql://192.168.0.166:3306/udi_wms_ct?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + jdbc-url: jdbc:mysql://127.0.0.1:3306/udi_wms_cl?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true username: root password: 123456 hikari: diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 34f13bdc6..cceafdccb 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -20,12 +20,12 @@ mybatis-plus: pagehelper: helperDialect: mysql - support-methods-arguments: false + support-methods-arguments: true params: count=countsql offset-as-page-num: false row-bounds-with-count: false page-size-zero: true - reasonable: false + reasonable: true returnPageInfo: none auto-dialect: true auto-runtime-dialect: true