已开启
add: DBCP 连接池适配 openGauss B 兼容模式示例与测试 #104
liuhongwei创建于 8月7日
add: DBCP 连接池适配 openGauss B 兼容模式示例与测试 #104
已开启
合并受阻
8月7日 创建了 pull request,commit 33d24b23
8月7日 添加了label:sig/Infra
opengauss_bot
8月7日 评论:
8月7日 评论:
Welcome To openGauss Community
Hey @liuhongwei-2026 , thanks for your contribution to the community.
Bot Usage Manual
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.
Contact Guide
If you have any questions, please contact the SIG: Infra ,
and any of the maintainers: @CarrotGo, @chendong76, @chenxiaobin19, @congzhou2603, @dodders, @hwworkholic, @jemappellehc, @muyulinzhong, @quemingjian, @shenzheng4, @shirley_zhengx, @superlchf, @totaj, @wlff234, @wofanzheng, @ywzq1161327784 ,
and any of the committers: @ailoooong, @gzbang, @libiao2024, @zhangxubo .


8月7日 添加了label:opengauss-cla/no
8月7日 修改标题为 “add: DBCP 连接池适配 openGauss B 兼容模式示例与测试”,原标题为“add: DBCP ���ӳ����� openGauss B ����ģʽʾ�������”
8月7日 修改标题为 “add: DBCP 连接池适配 openGauss B 兼容模式示例与测试”,原标题为“add: DBCP ���ӳ����� openGauss B ����ģʽʾ�������”
此处折叠了112条消息 查看更多
6 天前 删除了label:stat/needs-squash
opengauss_bot
6 天前 评论:
6 天前 评论:
6 天前 添加了label:opengauss-cla/yes
opengauss_bot
6 天前 评论:
6 天前 评论:
关联任务
https://atomgit.com/opengauss/opensource-intership/issues/52
变更内容
连接链路
DBCP 负责逻辑连接的借出、校验和归还;池中没有可复用连接且未达到
maxTotal时,才调用 Connector/J 创建物理连接。Connector/J 负责 MySQL 协议通信,Dolphin 将请求交给 openGauss 执行。测试清单
DbcpDataSourceTestConnectionPoolTestConnectionValidationTestCrudTestTransactionTestSqlCategoryTestDataTypeCharsetTestConstraintTestStabilityTest重点边界
dbcp.properties → TestConfig → BasicDataSourceFactory → BasicDataSource参数逐项断言。maxTotal=8时,8 条连接分别完成事务 CRUD 并保持占用;第 9 条请求等待且不突破上限,不释放时超时,释放后恢复。INSERT → SELECT → UPDATE → SELECT → DELETE → COMMIT,结束active=0。maxTotal=128的高负载验证完成 128 条同时持有连接和最多 5000 个排队业务请求;5000 表示请求数,不是物理连接数。commit后数据跨连接可见,rollback后不可见。CREATEROLE权限的opengauss测试账号;生产部署应替换为专用业务账号。testOnBorrow和testWhileIdle能淘汰失效连接并恢复查询。验证结果
测试环境:openEuler 24.03 x86_64、openGauss 7.0.0 master 转测包、Dolphin
127.0.0.1:36443(隔离自测端口;README 默认部署端口为3308)、BiSheng JDK 8u472、Maven 3.6.3、DBCP2 2.9.0、Pool2 2.10.0、Connector/J 8.0.28。另使用 Spring Boot 3.5.7 + HikariCP 6.3.3 + Connector/J 8.0.28 验证默认数据源链路,确认
HikariDataSource → HikariProxyConnection → ConnectionImpl → Dolphin → openGauss,JdbcTemplateCRUD、TransactionTemplate提交/回滚及连接归还均通过。该结果用于说明 Spring Boot 默认 HikariCP 链路,不计入 DBCP 的 46 个测试方法。运行方式
mvn clean test \ -Ddbcp.url='jdbc:mysql://127.0.0.1:36443/mysql_test_db?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL' \ -Ddbcp.username=opengauss \ -Ddbcp.password="$DBCP_PASSWORD"完整初始化、配置和验证说明见本 PR 的
README.md、docs/初始化步骤.md和docs/自测报告.md。关联 PR