From 55c57688c87605384c77eca0c47bc35bcb076a36 Mon Sep 17 00:00:00 2001 From: lyl2008dsg Date: Sat, 31 Aug 2024 16:33:03 +0800 Subject: [PATCH] make exception message generic for all database drivers --- changes/en-us/2.x.md | 1 + changes/zh-cn/2.x.md | 1 + .../apache/seata/core/store/db/AbstractDataSourceProvider.java | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changes/en-us/2.x.md b/changes/en-us/2.x.md index a779856f936..c70b7709c48 100644 --- a/changes/en-us/2.x.md +++ b/changes/en-us/2.x.md @@ -29,6 +29,7 @@ Add changes here for all PR submitted to the 2.x branch. - [[#6765](https://github.com/apache/incubator-seata/pull/6765)] fix MySQL driver loading by replacing custom classloader with system classloader for better compatibility and simplified process - [[#6781](https://github.com/apache/incubator-seata/pull/6781)] the issue where the TC occasionally fails to go offline from the NamingServer - [[#6797](https://github.com/apache/incubator-seata/pull/6797)] fall back to any of available cluster address when query cluster address is empty +- [[#6791](https://github.com/apache/incubator-seata/pull/6791)] make exception message generic for all database drivers ### optimize: diff --git a/changes/zh-cn/2.x.md b/changes/zh-cn/2.x.md index a915329758b..88676df8129 100644 --- a/changes/zh-cn/2.x.md +++ b/changes/zh-cn/2.x.md @@ -30,6 +30,7 @@ - [[#6765](https://github.com/apache/incubator-seata/pull/6765)] 改进MySQL驱动加载机制,将自定义类加载器替换为系统类加载器,更兼容简化流程 - [[#6781](https://github.com/apache/incubator-seata/pull/6781)] 修复tc下线时,由于定时任务没有先关闭,导致下线后还会被注册上,需要靠namingserver的健康检查来下线的bug - [[#6797](https://github.com/apache/incubator-seata/pull/6797)] 当查询的集群地址为空时,获取可用的任意集群地址 +- [[#6791](https://github.com/apache/incubator-seata/pull/6791)] 使异常消息对所有数据库驱动程序通用 ### optimize: diff --git a/core/src/main/java/org/apache/seata/core/store/db/AbstractDataSourceProvider.java b/core/src/main/java/org/apache/seata/core/store/db/AbstractDataSourceProvider.java index 9cca970ea69..c11a55f0979 100644 --- a/core/src/main/java/org/apache/seata/core/store/db/AbstractDataSourceProvider.java +++ b/core/src/main/java/org/apache/seata/core/store/db/AbstractDataSourceProvider.java @@ -80,7 +80,7 @@ public void validate() { driverClassPath = folderPath + "/jdbc/"; } throw new StoreException(String.format( - "the {%s} can't be found in the path %s, please copy database driver dependencies, such as `mysql-connector-java.jar` to the path.", driverClassName, driverClassPath)); + "The driver {%s} cannot be found in the path %s. Please ensure that the appropriate database driver dependencies are included in the classpath.", driverClassName, driverClassPath)); } }